define('BACKUP_DIR', realpath(__DIR__ . '/app/backup') . DIRECTORY_SEPARATOR); define('CONTROLLERS_DIR', realpath(__DIR__ . '/app/controllers') . DIRECTORY_SEPARATOR); define('MODELS_DIR', realpath(__DIR__ . '/app/models') . DIRECTORY_SEPARATOR); define('VIEWS_DIR', realpath(__DIR__ . '/app/views') . DIRECTORY_SEPARATOR); define('LANGUAGES_DIR', realpath(__DIR__ . '/app/languages') . DIRECTORY_SEPARATOR); define('LIB_DIR', realpath(__DIR__ . '/lib') . DIRECTORY_SEPARATOR); define('CSS_DIR', __DIR__ . '/public/css' . DIRECTORY_SEPARATOR); define('IMG_DIR', Config::getConfig('base') . 'public/img/'); define('JS_DIR', __DIR__ . '/public/js' . DIRECTORY_SEPARATOR); define('LESS_DIR', realpath(__DIR__ . '/public/less') . DIRECTORY_SEPARATOR); //Set current language if (!isset($_SESSION[Config::$lang_session])) { $_SESSION[Config::$lang_session] = Config::getConfig(Config::$lang); } //Running the router $router = new \lib\Router(); //Compiling dynamic stylesheet if (Config::getPlugins('css') == 'lessCSS') { $lessFile = glob('public/less/*.less'); if (sizeof($lessFile) > 0) { $less = new lessc(); foreach ($lessFile as $value) { $filenames = explode('/', $value); $filename = $filenames[2]; $less->checkedCompile($value, strstr($value, '/', true) . '/css/' . substr($filename, 0, strpos($filename, '.')) . '.css'); } } } //Call caches header if (Config::getConfig(Config::$cache) == 'true') { $router->headerCache();
<?php $timeStart = microtime(true); include dirname(__FILE__) . '/common/common.php'; $router = new lib\Router(dirname(__FILE__) . '/src'); $router->action();