-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·63 lines (47 loc) · 1.36 KB
/
index.php
File metadata and controls
executable file
·63 lines (47 loc) · 1.36 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
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
<?php
/**
* meta
*
* Simple hierarchial data management
*
* @package meta
* @author Timothy J. Warren
* @copyright Copyright (c) 2012
* @link https://github.com/aviat4ion/meta
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
namespace Meta\Base;
// --------------------------------------------------------------------------
use \Whoops\Handler\PrettyPageHandler;
use \Whoops\Handler\JsonResponseHandler;
error_reporting(-1);
// Set the default paths
define('MM_BASE_PATH', __DIR__);
define('MM_SYS_PATH', __DIR__.'/Meta/Base/');
define('MM_APP_PATH', __DIR__.'/Meta/');
// Autoload vendors
require(MM_BASE_PATH . '/vendor/autoload.php');
// Setup error handling
$whoops = new \Whoops\Run();
$defaultHandler = new PrettyPageHandler();
$whoops->pushHandler($defaultHandler);
$whoops->register();
// Require the basic configuration file
require(MM_APP_PATH . 'config/config.php');
// Start the autoloader
spl_autoload_register(function($name) {
if ($name == '') return;
// load by namespace
$names = explode('\\', trim($name));
$ns_path = MM_BASE_PATH . '/' . implode('/', $names) . '.php';
if (is_file($ns_path))
{
require_once($ns_path);
}
});
// Require the most important files
require(MM_SYS_PATH . 'common.php');
// And away we go!
route();
// End of index.php