libretime/airtime_mvc/public/index.php

59 lines
1.7 KiB
PHP
Raw Normal View History

<?php
2014-11-28 01:10:23 +01:00
global $configRun;
2014-11-28 21:30:11 +01:00
global $extensions;
2014-11-28 01:10:23 +01:00
function showConfigCheckPage() {
if (!isset($configRun) || !$configRun) {
// This will run any necessary setup we need if
// configuration hasn't been initialized
airtimeCheckConfiguration();
}
2014-11-28 21:30:11 +01:00
require_once(CONFIG_PATH . 'config-check.php');
2014-11-28 01:10:23 +01:00
die();
}
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/');
define('AIRTIME_CONFIG', 'airtime.conf');
2012-09-12 17:45:08 +02:00
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
if (file_exists(BUILD_PATH . AIRTIME_CONFIG)) {
2014-11-28 01:10:23 +01:00
/*
* Even if the user has been through the setup process and
* created an airtime.conf file (or they may have simply
* copied the example file) their settings aren't necessarily
* correctly configured.
*
* If something is improperly configured, show the user a
* configuration checklist page so they know what went wrong
*/
if (!airtimeCheckConfiguration()) {
$configRun = true;
showConfigCheckPage();
2012-09-12 17:45:08 +02:00
}
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-11-28 21:30:11 +01:00
require_once(SETUP_PATH . 'setup-config.php');
}