2012-06-13 13:49:10 -04:00
|
|
|
<?php
|
|
|
|
/**
|
2015-08-04 16:45:24 -04:00
|
|
|
* meta
|
2012-06-13 13:49:10 -04:00
|
|
|
*
|
2015-08-04 16:45:24 -04:00
|
|
|
* Simple hierarchial data management
|
2012-06-13 13:49:10 -04:00
|
|
|
*
|
2015-08-04 16:45:24 -04:00
|
|
|
* @package meta
|
2012-06-13 13:49:10 -04:00
|
|
|
* @author Timothy J. Warren
|
2015-08-04 16:45:24 -04:00
|
|
|
* @copyright Copyright (c) 2012
|
|
|
|
* @link https://github.com/aviat4ion/meta
|
2012-06-14 16:33:16 -04:00
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
2012-06-13 13:49:10 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2015-08-04 16:45:24 -04:00
|
|
|
namespace Meta\Base;
|
2012-06-14 16:33:16 -04:00
|
|
|
|
2012-06-13 13:49:10 -04:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2012-06-14 16:33:16 -04:00
|
|
|
|
2015-06-04 15:46:30 -04:00
|
|
|
use \Whoops\Handler\PrettyPageHandler;
|
|
|
|
use \Whoops\Handler\JsonResponseHandler;
|
|
|
|
|
2012-06-14 16:33:16 -04:00
|
|
|
error_reporting(-1);
|
2012-06-13 13:49:10 -04:00
|
|
|
|
|
|
|
// Set the default paths
|
|
|
|
define('MM_BASE_PATH', __DIR__);
|
2015-08-04 16:45:24 -04:00
|
|
|
define('MM_SYS_PATH', __DIR__.'/Meta/Base/');
|
|
|
|
define('MM_APP_PATH', __DIR__.'/Meta/');
|
2012-06-13 13:49:10 -04:00
|
|
|
|
2015-06-04 14:30:42 -04:00
|
|
|
// Autoload vendors
|
|
|
|
require(MM_BASE_PATH . '/vendor/autoload.php');
|
|
|
|
|
2015-06-04 16:25:47 -04:00
|
|
|
// Setup error handling
|
|
|
|
$whoops = new \Whoops\Run();
|
|
|
|
$defaultHandler = new PrettyPageHandler();
|
|
|
|
$whoops->pushHandler($defaultHandler);
|
|
|
|
$whoops->register();
|
|
|
|
|
2012-06-13 13:49:10 -04:00
|
|
|
// Require the basic configuration file
|
2015-06-04 14:30:42 -04:00
|
|
|
require(MM_APP_PATH . 'config/config.php');
|
2012-06-13 13:49:10 -04:00
|
|
|
|
2015-08-04 16:45:24 -04:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-06-13 13:49:10 -04:00
|
|
|
// Require the most important files
|
|
|
|
require(MM_SYS_PATH . 'common.php');
|
|
|
|
|
|
|
|
// And away we go!
|
2015-08-04 16:45:24 -04:00
|
|
|
route();
|
2012-06-13 13:49:10 -04:00
|
|
|
|
2012-06-14 16:33:16 -04:00
|
|
|
// End of index.php
|