libretime/airtime_mvc/public/index.php

56 lines
1.5 KiB
PHP
Raw Permalink Normal View History

<?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
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();
}
function isApiCall() {
$path = $_SERVER['PHP_SELF'];
return strpos($path, "api") !== false;
}
2014-11-28 21:30:11 +01:00
// Define application path constants
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/');
2014-12-09 23:48:16 +01:00
define("AIRTIME_CONFIG_STOR", "/etc/airtime/");
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');
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.
if (array_key_exists('config', $_GET)) {
showConfigCheckPage();
}
// 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');
}
// 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');
}