2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
2014-12-01 21:49:53 +01:00
|
|
|
$configRun = false;
|
|
|
|
$extensions = get_loaded_extensions();
|
|
|
|
$airtimeSetup = false;
|
2014-11-28 01:10:23 +01:00
|
|
|
|
|
|
|
function showConfigCheckPage() {
|
2014-12-01 21:49:53 +01:00
|
|
|
global $configRun;
|
|
|
|
if (!$configRun) {
|
2014-11-28 01:10:23 +01:00
|
|
|
// This will run any necessary setup we need if
|
|
|
|
// configuration hasn't been initialized
|
2014-12-04 00:04:47 +01:00
|
|
|
checkConfiguration();
|
2014-11-28 01:10:23 +01:00
|
|
|
}
|
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once(CONFIG_PATH . 'config-check.php');
|
2014-11-28 01:10:23 +01:00
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
2015-01-16 22:15:16 +01:00
|
|
|
function isApiCall() {
|
|
|
|
$path = $_SERVER['PHP_SELF'];
|
|
|
|
return strpos($path, "api") !== false;
|
|
|
|
}
|
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
// Define application path constants
|
2014-11-28 00:47:05 +01:00
|
|
|
define('ROOT_PATH', dirname( __DIR__) . '/');
|
|
|
|
define('LIB_PATH', ROOT_PATH . 'library/');
|
|
|
|
define('BUILD_PATH', ROOT_PATH . 'build/');
|
2014-11-28 21:30:11 +01:00
|
|
|
define('SETUP_PATH', BUILD_PATH . 'airtime-setup/');
|
|
|
|
define('APPLICATION_PATH', ROOT_PATH . 'application/');
|
|
|
|
define('CONFIG_PATH', APPLICATION_PATH . 'configs/');
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2014-12-09 23:48:16 +01:00
|
|
|
define("AIRTIME_CONFIG_STOR", "/etc/airtime/");
|
|
|
|
|
2014-11-28 00:47:05 +01:00
|
|
|
define('AIRTIME_CONFIG', 'airtime.conf');
|
2012-09-12 17:45:08 +02:00
|
|
|
|
2014-12-01 21:49:53 +01:00
|
|
|
require_once(LIB_PATH . "propel/runtime/lib/Propel.php");
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once(CONFIG_PATH . 'conf.php');
|
|
|
|
require_once(SETUP_PATH . 'load.php');
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
// This allows us to pass ?config as a parameter to any page
|
|
|
|
// and get to the config checklist.
|
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
|
2014-12-09 23:48:16 +01:00
|
|
|
if (file_exists(AIRTIME_CONFIG_STOR . AIRTIME_CONFIG)) {
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once(APPLICATION_PATH . 'airtime-boot.php');
|
2014-11-28 00:47:05 +01:00
|
|
|
}
|
|
|
|
// Otherwise, we'll need to run our configuration setup
|
|
|
|
else {
|
2014-12-01 21:49:53 +01:00
|
|
|
$airtimeSetup = true;
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once(SETUP_PATH . 'setup-config.php');
|
2012-09-05 23:29:34 +02:00
|
|
|
}
|
|
|
|
|