Пример #1
0
<?php

error_reporting(3);
function __autoload($ClassName)
{
    $ClassName = preg_replace("/\\\\/", "/", $ClassName);
    if (file_exists($ClassName . ".php")) {
        include_once $ClassName . ".php";
    }
}
include "config.php";
$router = new \system\Router();
$router->loadPage();
Пример #2
0
if (system\Config::$app['csrf']) {
    require 'csrf.php';
}
/* SET HOME URL */
define('HOME', system\Config::$app['base_url']);
define('PUBLICS', HOME . 'app/publics/');
define('PICTURES', PUBLICS . 'images/');
define('STYLESHEETS', PUBLICS . 'css/');
define('JAVASCRIPT', PUBLICS . 'js/');
/* CACHE */
$enable_cache = system\Config::$app['cache'];
if ($enable_cache) {
    require_once __DIR__ . DS . 'system' . DS . 'cache.php';
}
/* ROUTER */
$router = new system\Router();
if (isset($_SERVER['PATH_INFO'])) {
    $uri = $_SERVER['PATH_INFO'];
    if (!Security::Instance()->filter($uri)) {
        $uri = '/denied';
    }
    $router->pathRoute($uri);
} else {
    $router->defaultRoute();
}
$router->launch();
if (!is_null($view = system\kernel\View::instance())) {
    $view->launch();
}
/* END CACHE */
if ($enable_cache) {