sintonia/airtime_mvc/public/index.php
Albert Santoni 11c6818e61 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 16:05:29 -04:00

65 lines
1.9 KiB
PHP

<?php
$configRun = false;
$extensions = get_loaded_extensions();
$airtimeSetup = false;
function showConfigCheckPage() {
global $configRun;
if (!$configRun) {
// This will run any necessary setup we need if
// configuration hasn't been initialized
checkConfiguration();
}
require_once(CONFIG_PATH . 'config-check.php');
die();
}
function isApiCall() {
$path = $_SERVER['PHP_SELF'];
return strpos($path, "api") !== false;
}
// Define application path constants
define('ROOT_PATH', dirname( __DIR__) . '/');
define('LIB_PATH', ROOT_PATH . 'library/');
define('BUILD_PATH', ROOT_PATH . 'build/');
define('SETUP_PATH', BUILD_PATH . 'airtime-setup/');
define('APPLICATION_PATH', ROOT_PATH . 'application/');
define('CONFIG_PATH', APPLICATION_PATH . 'configs/');
define('VENDOR_PATH', ROOT_PATH . '../vendor/');
define("AIRTIME_CONFIG_STOR", "/etc/airtime/");
define('AIRTIME_CONFIG', 'airtime.conf');
//Vendors (Composer)
set_include_path(VENDOR_PATH . PATH_SEPARATOR . get_include_path());
// Ensure library/ is on include_path
set_include_path(LIB_PATH . PATH_SEPARATOR . get_include_path());
if (!@include_once(VENDOR_PATH . 'propel/propel1/runtime/lib/Propel.php'))
{
die('Error: Propel not found. Did you install Airtime\'s third-party dependencies with composer? (Check the README.)');
}
require_once(CONFIG_PATH . 'conf.php');
require_once(SETUP_PATH . 'load.php');
// 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(AIRTIME_CONFIG_STOR . AIRTIME_CONFIG)) {
require_once(APPLICATION_PATH . 'airtime-boot.php');
}
// Otherwise, we'll need to run our configuration setup
else {
$airtimeSetup = true;
require_once(SETUP_PATH . 'setup-config.php');
}