-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
executable file
·47 lines (44 loc) · 1.17 KB
/
bootstrap.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
38
39
40
41
42
43
44
45
46
47
<?php
error_reporting(0);
/**
* Загрузка модулей
*/
function loadedModules () {
$module = new module();
$module->load();
}
/**
* Загрузка модулей и отоброжение
*/
function load () {
$module = new module();
$module->load();
$view = new view();
$view->set_theme();
}
/**
* Подгрузка классов
*/
function autoloader ($class) {
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'theme' . DIRECTORY_SEPARATOR . 'options.php';
$options = new options();
$log = $options->log;
//-----------------------------------
$execute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . $class . '.php';
if (file_exists($execute)) {
if($log) {
echo "<p>[Инфо][Подгрузка] Загружена => \"{$class}\" :)</p>";
}
require_once $execute;
return true;
}
return false;
}
spl_autoload_register('autoloader');
autoloader('module');
autoloader('view');
if(!$_GET || $_GET['page'] >= 0 && isset($_GET['page'])) {
load();
} else {
loadedModules();
}