Dragon-Knight/server/bootstrap.php

35 lines
844 B
PHP

<?php
// @todo use a flag for this
ini_set('display_errors', 'on');
error_reporting(E_ALL | E_STRICT);
define('START', microtime(true)); // start the timer for this execution
session_start(); // initialize the session engine
// @todo move these to a settings config somewhere
const VERSION = '1.1.11';
const BUILD = '';
const DB = SERVER.'/database/dragon.db';
require_once SERVER.'/library.php'; // include our miscellaneous functions
// autoloader map
const MAP = [
// 'Class' => 'path/to/class.php',
// server-level classes
'App' => SERVER.'/app/app.php',
'Database' => SERVER.'/app/database.php',
'Request' => SERVER.'/app/request.php',
// modules
'HomeModule' => SERVER.'/modules/HomeModule.php',
];
// autoloader
spl_autoload_register(function($class) {
if (isset(MAP[$class])) require_once MAP[$class];
});