Вход Регистрация
Файл: index.php
Строк: 71
<?php
/**
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) 2013-2014, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
 * @link          http://perf-engine.net
 * @package       PerfEngine
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
// $time = microtime(true);
error_reporting(0);
 
# core constantes
define('ROOT'realpath(dirname(__FILE__))); 
define('SYS'ROOT .'/system'); 
define('TPL'ROOT .'/template');
define('URL''http://'$_SERVER['HTTP_HOST']);

# checking for installation or going to install
if (!file_exists(SYS .'/ini/db.ini')) { header('Location: /install/'); exit;}

# start of sessions
session_name('PSID');
session_start();

# setting encoding
mb_internal_encoding('UTF-8');

# require core files
require_once(SYS .'/inc/system.php');

# start of routing
$route = (isset($_GET['route']) ? input($_GET['route']) : '');
# if route is not empty
$route str_replace(array('../''..''./'), ''$route);
if(!empty(
$route))
{
    
# if exists index page of module showing it
    
if(is_file(ROOT.'/modules/'.$route.'/index.php'))
    {
        require_once(
ROOT.'/modules/'.$route.'/index.php');
    }
    
# if exists other page from module show it too
    
elseif(is_file(ROOT.'/modules/'.$route))
    {
        require_once(
ROOT.'/modules/'.$route);
    }
    
# or showing error page
    
else
    {
        require_once(
ROOT.'/modules/pages/not_found.php');
    }
}
# if is empty showing home page
elseif(!isset($route) || empty($route))
{
    require_once(
ROOT.'/modules/index.php');
}
// echo microtime(true)-$time;
Онлайн: 2
Реклама