-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.php
executable file
·75 lines (69 loc) · 1.44 KB
/
core.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* APLib - A PHP library to create your website smooth, easy & secure
*
* @package APLib
* @version 0.1
* @author ALMA PRO LEADER
* @license MIT License
* @copyright 2017-2018
* @link https://github.com/almapro/APLib/
*/
namespace APLib;
/**
* Include & initiate Loader class
*/
require_once __DIR__.'/loader.php';
\APLib\Loader::init();
/**
* Core - First class to call to boot the library
*/
class Core
{
/**
* @var array $loaded_files an array to contain realpath of each loaded file, so no file would be loaded twice
*/
public static $loaded_files = array(__FILE__);
/**
* Initiate the library
*
* @return void
*/
public static function init()
{
\APLib\Config::init();
\APLib\Config::common();
if(\APLib\Request\HTTP::post())
{
if(\APLib\Request\HTTP::json())
{
\APLib\FrontEnd::init();
}
}
\APLib\Cache::init();
\APLib\Security::init();
\APLib\Logger::init();
\APLib\Optimizer::init();
\APLib\Response::init();
}
/**
* Run the library
*
* @return void
*/
public static function run()
{
if(\APLib\Request\HTTP::post())
{
if(\APLib\Request\HTTP::json())
{
\APLib\FrontEnd::run();
}
}
\APLib\Security::run();
\APLib\Logger::run();
\APLib\Optimizer::run();
\APLib\Response::run();
}
}
?>