// Define App Root // Check if 'app' folder is in the same directory (Simple Deployment) or one level up (Standard/Secure Deployment) if (is_dir(__DIR__ . '/app')) { define('APP_ROOT', __DIR__); } else { define('APP_ROOT', dirname(__DIR__)); } // Define Public Path (for uploads etc) define('PUBLIC_PATH', is_dir(APP_ROOT . '/public') ? APP_ROOT . '/public' : APP_ROOT); // Load Config require_once APP_ROOT . '/config/config.php'; // Autoloader for Core classes spl_autoload_register(function ($className) { if (file_exists(APP_ROOT . '/app/Core/' . $className . '.php')) { require_once APP_ROOT . '/app/Core/' . $className . '.php'; } }); // Init Core App $init = new App();