2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
define('ROOT_PATH', dirname( __DIR__) . '/');
|
|
|
|
define('WEB_ROOT_PATH', __DIR__ . '/');
|
|
|
|
define('LIB_PATH', ROOT_PATH . 'library/');
|
|
|
|
define('BUILD_PATH', ROOT_PATH . 'build/');
|
|
|
|
define('SETUP_DIR', 'airtime-setup/');
|
2011-02-02 02:28:38 +01:00
|
|
|
|
2010-12-07 20:19:27 +01:00
|
|
|
// Define path to application directory
|
2014-11-28 00:47:05 +01:00
|
|
|
define('APPLICATION_PATH', ROOT_PATH . 'application');
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
define('AIRTIME_CONFIG', 'airtime.conf');
|
2012-09-12 17:45:08 +02:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
require_once(APPLICATION_PATH . "/configs/conf.php");
|
|
|
|
require_once(BUILD_PATH . SETUP_DIR . 'load.php');
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
function showConfigCheckPage() {
|
|
|
|
airtimeConfigureDatabase();
|
2012-04-13 23:45:28 +02:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
require_once(WEB_ROOT_PATH . 'config-check.php');
|
|
|
|
die();
|
2012-02-08 17:42:21 +01:00
|
|
|
}
|
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
if (array_key_exists('config', $_GET)) {
|
|
|
|
showConfigCheckPage();
|
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
// If a configuration file exists, forward to our boot script
|
|
|
|
if (file_exists(BUILD_PATH . AIRTIME_CONFIG)) {
|
|
|
|
airtimeConfigureDatabase();
|
2012-09-06 20:01:54 +02:00
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
// If the database doesn't exist, or is improperly configured,
|
|
|
|
// show the user a configuration error page so they know what went wrong
|
|
|
|
if (!airtimeCheckDatabase()) {
|
|
|
|
showConfigCheckPage();
|
2012-09-12 17:45:08 +02:00
|
|
|
}
|
2014-11-28 00:47:05 +01:00
|
|
|
|
|
|
|
require_once(WEB_ROOT_PATH . 'airtime-boot.php');
|
|
|
|
}
|
|
|
|
// Otherwise, we'll need to run our configuration setup
|
|
|
|
else {
|
|
|
|
require_once(BUILD_PATH . SETUP_DIR . 'setup-config.php');
|
2012-09-05 23:29:34 +02:00
|
|
|
}
|
|
|
|
|