public static function Init($root_dir) { self::SwitchDomain(); self::$start = microtime(true); define('IS_HTTPS', (bool) @$_SERVER['HTTPS']); define('IS_LIVE', static::IsLive()); if (!defined('DEBUG')) { define('DEBUG', !IS_LIVE); } define('APP_SHARED', 'Shared'); if (!defined('APP')) { define('APP', static::ResolveApp()); } mb_internal_encoding(static::$encoding); setlocale(LC_ALL, static::$locale); self::Directories($root_dir); self::IncludePath(); spl_autoload_register(array('\\Core\\Framework', 'Autoload'), true); // load configuration self::Config(); // run this as early as possible self::Timezone(); self::Session(); self::MagicQuotes(); // set up error logging and reporting self::ErrorReporting(); // load basic utility functions require_once 'Core/Basics.php'; self::Urls(); Assert::Init(DEBUG); ErrorHandler::Init(); static::Database(); }
private function error404($message = false) { header("HTTP/1.0 404 Not Found"); ErrorHandler::WriteLog("Page not found: " . URL_CURRENT_FULL, E_USER_NOTICE); //return render('404', compact('message'), URL_ROOT); $class = 'App\\' . APP . '\\Controller\\AppController'; $controller = new $class($this->url); $controller->setTitle('404 Not Found'); return $controller->renderAsFullPage('404', compact('message')); }
public static function init() { ErrorHandler::init(); //Notoj::enableCache("cache/test.php"); }