-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·37 lines (27 loc) · 1.25 KB
/
index.php
File metadata and controls
executable file
·37 lines (27 loc) · 1.25 KB
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();
// обозначение корня ресурса
$_url = dirname($_SERVER['SCRIPT_NAME']);
define('WWW_ROOT', 'http://'.$_SERVER['SERVER_NAME'].(strlen($_url) > 1 ? $_url : '').'/');
define('WWW_URI', 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
define('FS_ROOT', realpath('.').DIRECTORY_SEPARATOR);
/** определение ajax-запроса */
define('AJAX_MODE', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
/** индекс файл */
define('INDEX_FILE', basename(__FILE__));
// отправка Content-type заголовка
header('Content-Type: text/html; charset=utf-8');
// подключение файлов CMF
require_once(FS_ROOT.'setup.php');
// инициализация класса Request, чтобы отсеять ненужные запросы (favicon)
Request::get();
// сохранение статистики
UserStatistics_Model::get()->savePrimaryStatistics();
/** контроллер отображения по умолчанию */
define('DEFAULT_CONTROLLER', 'page');
// выполнение приложения
if(AJAX_MODE)
App::get()->ajax();
else
App::get()->run();
?>