forked from miquelfa/emuWAN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.php
More file actions
35 lines (30 loc) · 1.18 KB
/
Copy pathloader.php
File metadata and controls
35 lines (30 loc) · 1.18 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
<?php
/**
* App loader
*
* @author Miquel Ferrer Amer <miquel@miquelfa.com>
* @link http://miquelfa.com
*/
// Basic folders
define("FOLDER", dirname(__FILE__));
define("SRC", FOLDER . DIRECTORY_SEPARATOR . 'src');
define("PUBLICACCESS", FOLDER . DIRECTORY_SEPARATOR . 'public');
// Source folders
define("API", SRC . DIRECTORY_SEPARATOR . 'API' . DIRECTORY_SEPARATOR);
define("SCRIPTS", SRC . DIRECTORY_SEPARATOR . 'Scripts');
define("OSCOMMANDS", SRC . DIRECTORY_SEPARATOR . 'OSCommands');
// Public folders
define("TEMPLATES", PUBLICACCESS . DIRECTORY_SEPARATOR . 'templates');
// Autoregister all classes and functions
spl_autoload_register(function ($class) {
$class = str_replace("emuWAN\\", "", $class);
$class = str_replace("\\", DIRECTORY_SEPARATOR, $class);
$filename = SRC . DIRECTORY_SEPARATOR . $class . ".php";
include($filename);
});
// Include configuration parameters
if (!file_exists(dirname(__FILE__) . "/config.php")) {
die('Config file not found');
}
include(dirname(__FILE__) . "/config.php" );
?>