Developer Documentation

This document provides an overview of the functionality, configuration, and code implementation for the deployX Updater script.

Overview

The deployX Updater is a PHP-based utility designed to manage updates for any web software. It performs the following tasks:

Configuration

File Structure

Dependencies

Main Functionalities

File Verification

Ensures that required files (changelog.html and ignore.txt) exist before continuing.

File Comparison

Compares files between two directories (phpix-old and phpix) by hashing normalized content. Modified and new files are saved to modified_files.txt.

Update Process

Output Generation

Key Functions

delay

function delay($seconds = 1) { sleep($seconds); }

Simulates a delay to manage output flow.

getNormalizedFileHashes

function getNormalizedFileHashes($dir, $ignorePatterns) { // Logic for hashing files after normalizing content }

Recursively hashes files in a directory while ignoring specified patterns.

shouldIgnore

function shouldIgnore($filePath, $patterns) { // Logic to match file paths against ignore patterns }

Determines if a file should be ignored based on wildcard patterns.

deleteDirectoryContents

function deleteDirectoryContents($dir) { // Recursively deletes all files and directories within the specified folder }

Error Handling

Execution Notes

Ensure the following before running the script: