2024-07-11 18:17:51 -05:00
|
|
|
<?php
|
2024-07-01 20:53:23 -05:00
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
// @todo use a flag for this
|
2024-07-01 20:53:23 -05:00
|
|
|
ini_set('display_errors', 'on');
|
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
define('START', microtime(true)); // start the timer for this execution
|
2024-07-01 20:53:23 -05:00
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
session_start(); // initialize the session engine
|
2024-07-01 20:53:23 -05:00
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
// @todo move these to a settings config somewhere
|
2024-07-01 20:53:23 -05:00
|
|
|
const VERSION = '1.1.11';
|
|
|
|
const BUILD = '';
|
|
|
|
const DB = SERVER.'/database/dragon.db';
|
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
require_once SERVER.'/library.php'; // include our miscellaneous functions
|
|
|
|
|
2024-07-11 20:47:39 -05:00
|
|
|
// define whether we are installed or not
|
|
|
|
define('INSTALLED', file_exists(SERVER.'/.installed'));
|
|
|
|
|
2024-07-11 18:17:51 -05:00
|
|
|
// 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
|
2024-07-11 21:17:06 -05:00
|
|
|
'HomeModule' => SERVER.'/modules/HomeModule.php',
|
|
|
|
'InstallModule' => SERVER.'/modules/InstallModule.php',
|
2024-07-13 23:15:25 -05:00
|
|
|
|
|
|
|
// models
|
|
|
|
'Classes' => SERVER.'/models/Classes.php',
|
|
|
|
'Player' => SERVER.'/models/Player.php',
|
2024-07-15 16:24:52 -05:00
|
|
|
'Spell' => SERVER.'/models/Spell.php',
|
2024-07-11 18:17:51 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
// autoloader
|
|
|
|
spl_autoload_register(function($class) {
|
|
|
|
if (isset(MAP[$class])) require_once MAP[$class];
|
|
|
|
});
|