<?php
// Configuration file for M-AUTO project
// This file contains environment-specific settings
// Environment detection
$is_production = (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] === 'm-auto.co');
if ($is_production) {
// Production settings (VPS/cPanel)
define('DB_HOST', 'localhost');
define('DB_USERNAME', 'm11'); // Replace with actual cPanel database username
define('DB_PASSWORD', 'TCZutqbx0gsv%52?'); // Replace with actual cPanel database password
define('DB_NAME', 'm11'); // Replace with actual cPanel database name
// Production URLs
define('BASE_URL', 'https://m-auto.co');
define('ADMIN_URL', 'https://m-auto.co/admin');
// Error reporting (disabled in production)
error_reporting(0);
ini_set('display_errors', 0);
// Security settings
define('SECURE_COOKIES', true);
define('SESSION_SECURE', true);
} else {
// Development settings (localhost/XAMPP)
define('DB_HOST', 'localhost');
define('DB_USERNAME', 'm11');
define('DB_PASSWORD', 'TCZutqbx0gsv%52?');
define('DB_NAME', 'm11');
// Development URLs
define('BASE_URL', 'http://localhost/m11');
define('ADMIN_URL', 'http://localhost/m11/admin');
// Error reporting (enabled in development)
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Security settings
define('SECURE_COOKIES', false);
define('SESSION_SECURE', false);
}
// Common settings for both environments
define('SITE_NAME', 'M-AUTO');
define('CHARSET', 'utf8mb4');
define('TIMEZONE', 'Africa/Cairo');
// Set timezone
date_default_timezone_set(TIMEZONE);
// Session configuration
if (session_status() === PHP_SESSION_NONE) {
session_start([
'cookie_secure' => SECURE_COOKIES,
'cookie_httponly' => true,
'cookie_samesite' => 'Strict'
]);
}
?>