PDO::ERRMODE_EXCEPTION ]); // Save configuration $configContent = " PDO::ERRMODE_EXCEPTION,\n" . " PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n" . " ]);\n" . " }\n" . " return \$pdo;\n" . "}\n"; if (!is_dir(__DIR__ . '/db')) { mkdir(__DIR__ . '/db', 0755, true); } file_put_contents($configFile, $configContent); header("Location: ?step=3"); exit; } catch (PDOException $e) { $error = "Database Connection Failed: " . $e->getMessage(); } } elseif ($step === 3) { require_once $configFile; try { $pdo = db(); $schemaFile = __DIR__ . '/db/migrations/schema.sql'; if (!file_exists($schemaFile)) { throw new Exception("Schema file not found at $schemaFile"); } $sql = file_get_contents($schemaFile); $pdo->exec($sql); header("Location: ?step=4"); exit; } catch (Exception $e) { $error = "Migration Failed: " . $e->getMessage(); } } elseif ($step === 4) { require_once $configFile; try { $pdo = db(); $seedsFile = __DIR__ . '/db/migrations/seeds.sql'; if (!file_exists($seedsFile)) { throw new Exception("Seeds file not found at $seedsFile"); } $sql = file_get_contents($seedsFile); $pdo->exec($sql); header("Location: ?step=5"); exit; } catch (Exception $e) { $error = "Seeding Failed: " . $e->getMessage(); } } } ?>
Setup your platform in 5 easy steps
Welcome to the platform installation wizard! We will guide you through setting up the database, migrating tables, and loading the initial data.
Enter your database credentials below. If `db/config.php` already exists, the fields will be pre-filled.
Your database configuration is valid! The next step is to create the necessary tables in your database using the schema file.
Tables have been created successfully! The next step is to insert the initial data (seeds) into the database.
Your platform has been successfully installed and configured.
install.php file from your server to prevent unauthorized re-installation.