-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.php
executable file
·46 lines (40 loc) · 1.15 KB
/
loader.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
<?php
/**
* Include necessary files, and setting class autoloader
*
* @copyright Copyright 2014 - MidichlorianPHP and contributors
* @author NAYRAND Jérémie (dreadlokeur) <[email protected]>
* @version 1.0.1dev2
* @license GNU General Public License 3 http://www.gnu.org/licenses/gpl.html
* @package MidichloriansPHP
*/
use MidiChloriansPHP\Autoloader;
// Checking
if (!version_compare(PHP_VERSION, '5.4.0', '>='))
throw new \Exception('You must have at least PHP 5.4.0');
// Include neccesary files
require_once 'paths.php';
// Composer autoloader
require_once PATH_VENDOR . 'autoload.php';
// Autoloader configuration
$autoloader = new Autoloader();
$autoloader->setAutoloadExtensions(array(
'class.php',
'abstract.php',
'final.php',
'interface.php',
'trait.php',
'php'
));
$autoloader->addNamespaces(array(
'libs' => PATH_LIBS,
'controllers' => PATH_CONTROLLERS,
'models' => PATH_MODELS,
));
// Include autoloaders adaptaters
$autoloader->registerAutoloaders(array(
'Includer' => array('prepend' => true),
'Cache' => array('prepend' => true),
'Finder' => array('prepend' => true),
));
?>