forked from instantsoft/icms2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·37 lines (25 loc) · 993 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
session_start();
define('VALID_RUN', true);
// Устанавливаем кодировку
header('Content-type:text/html; charset=utf-8');
header('X-Powered-By: InstantCMS');
require_once 'bootstrap.php';
if (cmsConfig::get('emulate_lag')) { usleep(350000); }
// Инициализируем шаблонизатор
$template = cmsTemplate::getInstance();
if (href_to('auth', 'login') != $_SERVER['REQUEST_URI']){
if (!cmsConfig::get('is_site_on') && !cmsUser::isAdmin()) {
cmsCore::errorMaintenance();
}
}
cmsEventsManager::hook('engine_start');
//Запускаем роутинг и контроллер
$core->route($_SERVER['REQUEST_URI']);
$core->runController();
$core->runWidgets();
//Выводим готовую страницу
$template->renderPage();
cmsEventsManager::hook('engine_stop');
// Останавливаем кеш
cmsCache::getInstance()->stop();