GeniXCMS

Install Class

categoryAPI edit_calendar31 Mar 2026

Installation Core Class


The Install class is the foundational logic behind the GeniXCMS automated web wizard. It handles the critical transition from an empty directory to a fully functional CMS by managing filesystem configuration, database schema initialization, and initial administrator provisioning.


⚡ Core Installation Methods

Install::makeConfig($file_path)

This method generates the primary config.php file within the inc/config/ directory.

  • Data Source: It extracts database credentials and site parameters from the active installation session.
  • Output: Returns a string containing the full PHP configuration content or a success/failure message.
// Typically used within the installation wizard controller
Install::makeConfig(INC_LIB . 'config/config.php');

Install::createTable()

Orchestrates the creation of all core system tables.

  • Process: It executes a structured SQL stack to build tables for Posts, Pages, Users, Options, and Categories.
  • Return: boolean (Success of the schema build).
if (Install::createTable()) {
    // Proceed to administrator account setup
}

🏗️ Installation Lifecycle

The Install class is typically invoked during the 4-stage browser-based wizard:

  1. Environment Check: Verifies PHP versions and required extensions (pdo, gd, mbstring).
  2. Configuration: Collects database (MySQL/SQLite) and site metadata.
  3. Schema Build: Triggers createTable() to initialize the database structure.
  4. Finalization: Executes makeConfig() to lock the settings into a physical file.

🛡️ Security Post-Installation

The Install class includes built-in checks to prevent accidental re-installations of an existing site.

  • File Detection: If inc/config/config.php exists, the installation routines are automatically bypassed.
  • Permission Warning: The system recommends setting config.php to Read-Only (chmod 444) after a successful run.

priority_high
ImportantManual Overrides: While the Install class handles the heavy lifting, developers can manually trigger schema updates using the Migration System for post-installation updates.

See Also