2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
2022-02-04 11:00:41 +01:00
|
|
|
require_once dirname(__DIR__) . '/application/preload.php';
|
|
|
|
|
2022-04-29 14:43:45 +02:00
|
|
|
// Early exit if a configuration file does not exists!
|
|
|
|
if (!file_exists(LIBRETIME_CONFIG_FILEPATH)) {
|
|
|
|
exit("could not find a configuration file at '{$LIBRETIME_CONFIG_FILEPATH}', please make sure it is properly set!");
|
|
|
|
}
|
|
|
|
|
2014-12-01 21:49:53 +01:00
|
|
|
$configRun = false;
|
|
|
|
$extensions = get_loaded_extensions();
|
|
|
|
$airtimeSetup = false;
|
2014-11-28 01:10:23 +01:00
|
|
|
|
2021-10-11 16:10:47 +02: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-09-29 20:22:10 +02:00
|
|
|
|
2022-02-04 11:00:41 +01:00
|
|
|
require_once CONFIG_PATH . '/config-check.php';
|
2021-10-11 16:10:47 +02:00
|
|
|
|
2022-07-11 17:07:30 +02:00
|
|
|
exit;
|
2014-11-28 01:10:23 +01:00
|
|
|
}
|
2012-09-10 23:36:55 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
function isApiCall()
|
|
|
|
{
|
2015-01-16 22:15:16 +01:00
|
|
|
$path = $_SERVER['PHP_SELF'];
|
2021-10-11 16:10:47 +02:00
|
|
|
|
|
|
|
return strpos($path, 'api') !== false;
|
2012-09-10 23:36:55 +02:00
|
|
|
}
|
2011-02-02 02:28:38 +01:00
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// Rest Module Controllers - for custom Rest_RouteController.php
|
2022-02-04 11:00:41 +01:00
|
|
|
set_include_path(APPLICATION_PATH . '/modules/rest/controllers/' . PATH_SEPARATOR . get_include_path());
|
2015-09-16 20:22:13 +02:00
|
|
|
|
2018-12-22 23:42:39 +01:00
|
|
|
// Vendors (Composer, zend-loader is explicitly specified due to https://github.com/zf1/zend-application/pull/2#issuecomment-102599655)
|
2022-02-04 11:00:41 +01:00
|
|
|
set_include_path(VENDOR_PATH . PATH_SEPARATOR . VENDOR_PATH . '/zf1s/zend-loader/library/' . PATH_SEPARATOR . get_include_path());
|
2014-07-23 22:13:55 +02:00
|
|
|
|
2010-12-07 20:19:27 +01:00
|
|
|
// Ensure library/ is on include_path
|
2015-05-22 22:05:29 +02:00
|
|
|
set_include_path(LIB_PATH . PATH_SEPARATOR . get_include_path());
|
2012-04-13 23:45:28 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
if (!class_exists('Propel')) {
|
|
|
|
exit('Error: Propel not found. Did you install Airtime\'s third-party dependencies with composer? (Check the README.)');
|
2012-02-08 17:42:21 +01:00
|
|
|
}
|
|
|
|
|
2022-04-29 14:43:45 +02:00
|
|
|
require_once APPLICATION_PATH . '/check.php';
|
2014-07-01 19:36:09 +02: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();
|
|
|
|
}
|
2015-02-06 21:20:01 +01:00
|
|
|
|
2022-04-29 14:43:45 +02:00
|
|
|
require_once APPLICATION_PATH . '/airtime-boot.php';
|