sintonia/legacy/public/index.php

80 lines
2.4 KiB
PHP
Raw 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
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
checkConfiguration();
2014-11-28 01:10:23 +01:00
}
2014-09-29 20:22:10 +02:00
2021-10-11 16:10:47 +02:00
require_once CONFIG_PATH . 'config-check.php';
exit();
2014-11-28 01:10:23 +01:00
}
2021-10-11 16:10:47 +02:00
function isApiCall()
{
$path = $_SERVER['PHP_SELF'];
2021-10-11 16:10:47 +02:00
return strpos($path, 'api') !== false;
}
2014-11-28 21:30:11 +01:00
// Define application path constants
2021-10-11 16:10:47 +02: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/');
2021-09-11 04:20:50 +02:00
define('VENDOR_PATH', ROOT_PATH . 'vendor/');
define('REST_MODULE_CONTROLLER_PATH', APPLICATION_PATH . 'modules/rest/controllers/');
2021-10-11 16:10:47 +02:00
define('AIRTIME_CONFIG_STOR', '/etc/airtime/');
define('AIRTIME_CONFIG', 'airtime.conf');
2012-09-12 17:45:08 +02:00
//Rest Module Controllers - for custom Rest_RouteController.php
set_include_path(REST_MODULE_CONTROLLER_PATH . PATH_SEPARATOR . get_include_path());
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)
set_include_path(VENDOR_PATH . PATH_SEPARATOR . VENDOR_PATH . 'zf1s/zend-loader/library/' . PATH_SEPARATOR . get_include_path());
// Ensure library/ is on include_path
Merge branch '2.5.x-installer' into saas-installer-albert Conflicts: .gitignore airtime_mvc/application/Bootstrap.php airtime_mvc/application/configs/conf.php airtime_mvc/application/controllers/SystemstatusController.php airtime_mvc/application/controllers/UpgradeController.php airtime_mvc/application/upgrade/Upgrades.php airtime_mvc/application/views/scripts/systemstatus/index.phtml airtime_mvc/build/airtime.conf airtime_mvc/build/sql/defaultdata.sql airtime_mvc/public/index.php airtime_mvc/tests/application/helpers/AirtimeInstall.php install_minimal/airtime-install install_minimal/include/airtime-constants.php install_minimal/include/airtime-copy-files.sh install_minimal/include/airtime-db-install.php install_minimal/include/airtime-initialize.sh install_minimal/include/airtime-install.php install_minimal/include/airtime-installed-check.php install_minimal/include/airtime-remove-files.sh install_minimal/include/airtime-upgrade.php python_apps/media-monitor/install/media-monitor-copy-files.py python_apps/monit/monit-airtime-generic.cfg python_apps/pypo/airtime-playout python_apps/pypo/install/pypo-copy-files.py python_apps/pypo/liquidsoap/generate_liquidsoap_cfg.py python_apps/pypo/liquidsoap/ls_script.liq python_apps/pypo/pypo/__main__.py python_apps/pypo/pypo/media/update/replaygain.py python_apps/pypo/pypo/media/update/replaygainupdater.py python_apps/pypo/pypo/media/update/silananalyzer.py python_apps/python-virtualenv/airtime_virtual_env.pybundle python_apps/python-virtualenv/requirements utils/airtime-check-system.php
2015-05-22 22:05:29 +02:00
set_include_path(LIB_PATH . PATH_SEPARATOR . get_include_path());
require_once VENDOR_PATH . '/autoload.php';
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.)');
}
2021-10-11 16:10:47 +02: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();
}
$filename = isset($_SERVER['AIRTIME_CONF']) ?
$_SERVER['AIRTIME_CONF'] : AIRTIME_CONFIG_STOR . AIRTIME_CONFIG;
// If a configuration file exists, forward to our boot script
if (file_exists($filename)) {
2021-10-11 16:10:47 +02: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;
2021-10-11 16:10:47 +02:00
require_once SETUP_PATH . 'setup-config.php';
}