Skip to content

i-net-software/pad-file-editor-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 PAD File Editor and Validator

A modern, user-friendly web application for validating and editing Portable Application Description (PAD) XML files. This tool helps software developers ensure their PAD files conform to the official PAD specification before submission to software directories.

PHP Version License

Repository: https://github.com/i-net-software/pad-file-editor-validator

⚠️ Disclaimer

This code was developed experimentally and is provided "as is" without any guarantees or warranties.

  • Use at your own risk
  • No warranty of any kind, express or implied
  • The code may contain bugs or unexpected behavior
  • Always validate your PAD files through official channels before submission
  • Backup your files before using the editor

✨ Features

Validator (index.php)

  • 🌐 URL-based Validation: Simply paste a PAD file URL and validate it instantly
  • 📁 Local File Support: Load PAD files from local file paths or URLs
  • ⚡ Asynchronous Processing: No page reloads - smooth, modern user experience
  • 🎨 Beautiful Modern UI: Clean, responsive design with gradient backgrounds and smooth animations
  • 📊 Detailed Reports: Comprehensive validation reports with clear error and warning messages
  • 📄 XML Source Viewer: View the raw XML source with syntax highlighting
  • 📋 Copy to Clipboard: Easily copy XML content with one click
  • 🔧 Encoding Detection: Automatically detects and handles various character encodings (UTF-8, ISO-8859-1, Windows-1252)
  • 🛡️ Robust Error Handling: Graceful handling of network errors, parse errors, and encoding issues
  • 📱 Responsive Design: Works perfectly on desktop, tablet, and mobile devices

Editor (editor.php)

  • ✏️ Full PAD File Editor: Create and edit complete PAD XML files with a user-friendly interface
  • 📝 All PAD Fields Supported: Comprehensive support for all PAD 4.0 specification fields including:
    • Program Information (name, version, type, release status, pricing, etc.)
    • Company Information (address, contact, support details)
    • Program Descriptions (multi-language support with all description lengths)
    • Web Information (URLs for info, order, screenshots, icons)
    • File Information (file sizes)
    • Expiration Information (with conditional fields)
    • Advanced settings (PAD version info, ASP membership)
  • 🌐 Load from URL or Local File: Load existing PAD files from HTTP/HTTPS URLs or local file paths
  • 💾 Save as XML: Export your edited PAD file as properly formatted XML
  • ✅ Built-in Validation: Validate your PAD file directly from the editor
  • 🌍 Multi-language Support: Add and manage descriptions in multiple languages
  • 🎯 Smart Field Visibility: Conditional fields appear based on your selections (e.g., expiration date fields)
  • 📋 Tabbed Interface: Organized tabs for easy navigation (Basic Info, Company, Descriptions, Web & URLs, Advanced)

🚀 Quick Start

Prerequisites

  • PHP 7.4 or higher (PHP 8.0+ recommended)
  • PHP Extensions:
    • mbstring (for encoding detection and conversion)
    • xml (for XML parsing)
    • dom (for XML manipulation)
    • curl (recommended) or allow_url_fopen enabled (for fetching remote files)

Installation

  1. Clone or download this repository:

    git clone https://github.com/i-net-software/pad-file-editor-validator.git
    cd pad-file-editor-validator
  2. That's it! No dependencies to install - it's pure PHP with no external package managers needed.

Running Locally

  1. Navigate to the project directory:

    cd pad-file-editor-validator
  2. Start the PHP built-in web server:

    php -S localhost:8000
  3. Open your browser and navigate to:

    http://localhost:8000
    
  4. Enter a PAD file URL (for example):

    https://download.inetsoftware.de/i-net-clear-reports.pad.xml
    
  5. Click "Validate PAD File" and wait for the results! 🎉

Alternative: Using a Web Server

If you prefer using Apache, Nginx, or another web server:

  1. Copy the project to your web server's document root (e.g., htdocs, www, or public_html)
  2. Ensure PHP is configured with the required extensions
  3. Access via your web browser at the appropriate URL

📋 Requirements Checklist

Before running, make sure you have:

  • ✅ PHP 7.4+ installed
  • mbstring extension enabled
  • xml extension enabled
  • dom extension enabled
  • curl extension enabled (recommended) OR allow_url_fopen enabled in php.ini

Checking PHP Extensions

To verify your PHP installation has the required extensions, run:

php -m | grep -E "(mbstring|xml|dom|curl)"

You should see all four extensions listed. If any are missing, install them using your system's package manager:

Ubuntu/Debian:

sudo apt-get install php-mbstring php-xml php-curl

macOS (Homebrew):

brew install php
# Extensions are usually included by default

Windows: Edit your php.ini file and uncomment the extension lines:

extension=mbstring
extension=xml
extension=dom
extension=curl

🎯 Usage

Using the Validator (index.php)

  1. Enter a PAD File URL or Local Path:
    • Paste the full URL to your PAD XML file (e.g., https://example.com/padfile.xml)
    • Or enter a local file path (e.g., /path/to/padfile.xml or ./padfile.xml)
  2. Click Validate: The validator will fetch and analyze the file
  3. Review Results:
    • ✅ Green badges indicate success
    • ⚠️ Yellow badges show warnings
    • ❌ Red badges indicate errors
  4. View XML Source: Click "View XML Source" to see the raw XML with syntax highlighting
  5. Copy XML: Use the copy button to quickly copy the XML content

Using the Editor (editor.php)

  1. Access the Editor: Click the "✏️ Open Editor" button from the validator page, or navigate directly to editor.php
  2. Load an Existing File (optional):
    • Enter a URL: https://example.com/padfile.xml
    • Or enter a local file path: /path/to/padfile.xml or ./padfile.xml
    • Click "Load" to populate the editor with existing data
    • Or click "Start Blank" to create a new PAD file from scratch
  3. Fill in the Fields:
    • Navigate through the tabs (Basic Info, Company, Descriptions, Web & URLs, Advanced)
    • Fill in all required fields (marked with *)
    • Add multiple language descriptions if needed
  4. Validate: Click "Validate" to check your PAD file against the specification
  5. Save: Click "Save as XML" to download your completed PAD file

🏗️ Project Structure

pad-file-editor-validator/
├── index.php              # Validator - main entry point (HTML + PHP)
├── editor.php             # Editor - PAD file creation and editing interface
├── include/
│   ├── padfile.php       # PAD file loading and parsing
│   ├── padvalidator.php  # Validation logic
│   ├── padspec.php       # PAD specification handling
│   └── xmlfile.php       # XML parsing and encoding detection
├── README.md             # This file
├── LICENSE               # MIT License
└── .gitignore           # Git ignore rules

🔧 Technical Details

Encoding Handling

The validator automatically:

  • Detects declared XML encoding
  • Verifies actual content encoding
  • Converts to UTF-8 for consistent processing
  • Reports encoding mismatches as warnings

Validation Process

  1. Load PAD File: Fetches XML from the provided URL
  2. Parse XML: Uses multiple parsers (DOMDocument, SimpleXML, xml_parse) for robustness
  3. Load PAD Spec: Fetches the official PAD specification
  4. Validate: Checks all required fields and formats
  5. Report: Displays errors, warnings, and success messages

Browser Support

  • ✅ Chrome/Edge (latest)
  • ✅ Firefox (latest)
  • ✅ Safari (latest)
  • ✅ Opera (latest)

🐛 Troubleshooting

"Cannot open URL" Error

  • Check your internet connection
  • Verify the URL is accessible (try opening it in a browser)
  • Ensure curl extension is installed or allow_url_fopen is enabled
  • Check for firewall/proxy issues

"Error loading Validator" Message

  • Ensure you have internet access (the validator needs to fetch the PAD spec)
  • Check PHP configuration for URL access permissions
  • Verify curl or allow_url_fopen is enabled

Encoding Warnings

  • These are informational warnings, not errors
  • The validator automatically converts encodings
  • Your PAD file will still be validated correctly

JSON Parse Errors

  • Clear your browser cache and try again
  • Check browser console for detailed error messages
  • Ensure PHP error reporting is not outputting to the response

🤝 Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest new features
  • 🔧 Submit pull requests
  • 📝 Improve documentation

📝 License

This project is open source and available under the MIT License.

🙏 Acknowledgments

  • Built with PHP and vanilla JavaScript
  • Uses Prism.js for syntax highlighting
  • Validates against the official PAD Specification

📞 Support

If you encounter any issues or have questions:

  1. Check the Troubleshooting section
  2. Review existing GitHub Issues
  3. Create a new issue with details about your problem

Happy Validating! 🎉

Made with ❤️ for the software development community

About

An editor and validator for the PAD file format used by public download sites.

Resources

License

Stars

Watchers

Forks

Languages