2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once CONFIG_PATH . "conf.php";
|
2013-01-14 20:43:02 +01:00
|
|
|
$CC_CONFIG = Config::getConfig();
|
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once CONFIG_PATH . "ACL.php";
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
// Since we initialize the database during the configuration check,
|
|
|
|
// check the $configRun global to avoid reinitializing unnecessarily
|
|
|
|
if (!isset($configRun) || !$configRun) {
|
|
|
|
Propel::init(CONFIG_PATH . 'airtime-conf-production.php');
|
|
|
|
}
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2014-12-09 23:58:36 +01:00
|
|
|
//Composer's autoloader
|
|
|
|
require_once 'autoload.php';
|
|
|
|
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once CONFIG_PATH . "constants.php";
|
2015-09-18 21:34:55 +02:00
|
|
|
/* Common */
|
2012-04-16 16:19:34 +02:00
|
|
|
require_once "DateHelper.php";
|
2014-11-04 22:57:40 +01:00
|
|
|
require_once "LocaleHelper.php";
|
2015-02-17 18:17:49 +01:00
|
|
|
require_once "FileDataHelper.php";
|
2014-11-20 17:22:53 +01:00
|
|
|
require_once "HTTPHelper.php";
|
2015-02-25 19:02:11 +01:00
|
|
|
require_once "FileIO.php";
|
2012-04-16 16:19:34 +02:00
|
|
|
require_once "OsPath.php";
|
2012-09-05 22:14:08 +02:00
|
|
|
require_once "Database.php";
|
2015-02-12 21:39:22 +01:00
|
|
|
require_once "ProvisioningHelper.php";
|
2015-06-12 19:48:54 +02:00
|
|
|
require_once "SecurityHelper.php";
|
2015-09-25 18:03:10 +02:00
|
|
|
require_once "SessionHelper.php";
|
2015-03-24 15:11:25 +01:00
|
|
|
require_once "GoogleAnalytics.php";
|
2013-01-09 19:38:38 +01:00
|
|
|
require_once "Timezone.php";
|
2015-09-18 21:34:55 +02:00
|
|
|
require_once "CeleryManager.php";
|
2015-06-15 21:12:37 +02:00
|
|
|
require_once "TaskManager.php";
|
2015-10-15 20:44:17 +02:00
|
|
|
require_once "PodcastManager.php";
|
2015-07-13 14:06:41 +02:00
|
|
|
require_once "UsabilityHints.php";
|
2015-08-01 00:28:16 +02:00
|
|
|
require_once __DIR__.'/models/formatters/LengthFormatter.php';
|
2015-09-24 18:56:32 +02:00
|
|
|
require_once __DIR__.'/common/widgets/Table.php';
|
2015-09-18 21:34:55 +02:00
|
|
|
/* Models */
|
|
|
|
require_once "Auth.php";
|
|
|
|
require_once 'Preference.php';
|
|
|
|
require_once 'Locale.php';
|
|
|
|
/* Enums */
|
2015-10-22 18:12:41 +02:00
|
|
|
require_once "Enum.php";
|
2015-09-18 21:34:55 +02:00
|
|
|
require_once "MediaType.php";
|
2015-10-22 18:12:41 +02:00
|
|
|
require_once "HttpRequestType.php";
|
2015-09-18 21:34:55 +02:00
|
|
|
/* Interfaces */
|
|
|
|
require_once "OAuth2.php";
|
|
|
|
require_once "OAuth2Controller.php";
|
2015-10-21 01:03:34 +02:00
|
|
|
require_once "Publish.php";
|
|
|
|
/* Factories */
|
|
|
|
require_once __DIR__.'/services/CeleryServiceFactory.php';
|
|
|
|
require_once __DIR__.'/services/PublishServiceFactory.php';
|
2015-09-18 21:34:55 +02:00
|
|
|
|
2012-11-27 23:11:29 +01:00
|
|
|
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
2015-01-14 02:51:46 +01:00
|
|
|
require_once __DIR__.'/forms/helpers/CustomDecorators.php';
|
2015-09-25 16:41:51 +02:00
|
|
|
require_once __DIR__.'/controllers/plugins/PageLayoutInitPlugin.php';
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
2014-04-24 22:19:55 +02:00
|
|
|
require_once __DIR__.'/controllers/plugins/Maintenance.php';
|
2015-03-24 15:11:25 +01:00
|
|
|
require_once __DIR__.'/controllers/plugins/ConversionTracking.php';
|
2015-02-04 21:09:27 +01:00
|
|
|
require_once __DIR__.'/modules/rest/controllers/ShowImageController.php';
|
2014-09-17 00:04:22 +02:00
|
|
|
require_once __DIR__.'/modules/rest/controllers/MediaController.php';
|
2015-01-16 23:27:52 +01:00
|
|
|
require_once __DIR__.'/upgrade/Upgrades.php';
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2015-01-28 19:19:50 +01:00
|
|
|
require_once (APPLICATION_PATH . "/logging/Logging.php");
|
2012-09-14 22:51:39 +02:00
|
|
|
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
2012-05-06 04:29:31 +02:00
|
|
|
|
2015-02-17 18:13:37 +01:00
|
|
|
// We need to manually route because we can't load Zend without the database being initialized first.
|
2015-03-03 21:29:34 +01:00
|
|
|
if (array_key_exists("REQUEST_URI", $_SERVER) && (stripos($_SERVER["REQUEST_URI"], "/provisioning/create") !== false)) {
|
2015-02-17 18:13:37 +01:00
|
|
|
$provisioningHelper = new ProvisioningHelper($CC_CONFIG["apiKey"][0]);
|
|
|
|
$provisioningHelper->createAction();
|
|
|
|
die();
|
2015-02-12 21:39:22 +01:00
|
|
|
}
|
|
|
|
|
2015-09-25 16:41:51 +02:00
|
|
|
Zend_Session::setOptions(array('strict' => true));
|
2013-01-14 20:43:02 +01:00
|
|
|
Config::setAirtimeVersion();
|
2014-11-28 21:30:11 +01:00
|
|
|
require_once (CONFIG_PATH . 'navigation.php');
|
2011-11-15 22:10:40 +01:00
|
|
|
|
2011-08-12 21:36:00 +02:00
|
|
|
Zend_Validate::setDefaultNamespaces("Zend");
|
|
|
|
|
|
|
|
$front = Zend_Controller_Front::getInstance();
|
2012-01-16 09:56:57 +01:00
|
|
|
$front->registerPlugin(new RabbitMqPlugin());
|
2015-03-24 15:11:25 +01:00
|
|
|
$front->registerPlugin(new Zend_Controller_Plugin_ConversionTracking());
|
2015-03-20 22:20:34 +01:00
|
|
|
$front->throwExceptions(false);
|
2011-08-12 21:36:00 +02:00
|
|
|
|
2012-01-16 09:56:57 +01:00
|
|
|
/* The bootstrap class should only be used to initialize actions that return a view.
|
2011-08-12 21:36:00 +02:00
|
|
|
Actions that return JSON will not use the bootstrap class! */
|
2010-12-07 20:19:27 +01:00
|
|
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|
|
|
{
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initDoctype()
|
2010-12-07 20:19:27 +01:00
|
|
|
{
|
|
|
|
$this->bootstrap('view');
|
|
|
|
$view = $this->getResource('view');
|
|
|
|
$view->doctype('XHTML1_STRICT');
|
|
|
|
}
|
2013-07-29 14:57:31 +02:00
|
|
|
|
2011-08-22 16:12:53 +02:00
|
|
|
protected function _initZFDebug()
|
|
|
|
{
|
2012-09-11 06:50:56 +02:00
|
|
|
|
2014-11-04 17:06:17 +01:00
|
|
|
Zend_Controller_Front::getInstance()->throwExceptions(false);
|
2012-09-11 06:50:56 +02:00
|
|
|
|
|
|
|
/*
|
2012-08-24 03:58:21 +02:00
|
|
|
if (APPLICATION_ENV == "development") {
|
2011-08-22 16:12:53 +02:00
|
|
|
$autoloader = Zend_Loader_Autoloader::getInstance();
|
|
|
|
$autoloader->registerNamespace('ZFDebug');
|
|
|
|
|
|
|
|
$options = array(
|
2012-01-16 09:56:57 +01:00
|
|
|
'plugins' => array('Variables',
|
2011-08-22 16:12:53 +02:00
|
|
|
'Exception',
|
|
|
|
'Memory',
|
|
|
|
'Time')
|
|
|
|
);
|
|
|
|
$debug = new ZFDebug_Controller_Plugin_Debug($options);
|
|
|
|
|
|
|
|
$this->bootstrap('frontController');
|
|
|
|
$frontController = $this->getResource('frontController');
|
|
|
|
$frontController->registerPlugin($debug);
|
|
|
|
}
|
2012-09-11 06:50:56 +02:00
|
|
|
*/
|
2011-08-22 16:12:53 +02:00
|
|
|
}
|
2012-01-16 09:56:57 +01:00
|
|
|
|
2011-12-22 01:01:29 +01:00
|
|
|
protected function _initRouter()
|
|
|
|
{
|
2012-08-24 03:58:21 +02:00
|
|
|
$front = Zend_Controller_Front::getInstance();
|
2011-12-22 01:01:29 +01:00
|
|
|
$router = $front->getRouter();
|
2014-08-14 23:22:01 +02:00
|
|
|
$front->setBaseUrl(Application_Common_OsPath::getBaseDir());
|
2015-04-10 23:14:56 +02:00
|
|
|
|
2011-12-22 01:01:29 +01:00
|
|
|
$router->addRoute(
|
|
|
|
'password-change',
|
|
|
|
new Zend_Controller_Router_Route('password-change/:user_id/:token', array(
|
|
|
|
'module' => 'default',
|
2012-04-17 18:16:10 +02:00
|
|
|
'controller' => 'login',
|
2011-12-22 01:01:29 +01:00
|
|
|
'action' => 'password-change',
|
|
|
|
)));
|
|
|
|
}
|
2014-04-24 22:19:55 +02:00
|
|
|
|
|
|
|
public function _initPlugins()
|
|
|
|
{
|
|
|
|
$front = Zend_Controller_Front::getInstance();
|
|
|
|
$front->registerPlugin(new Zend_Controller_Plugin_Maintenance());
|
2015-09-25 16:41:51 +02:00
|
|
|
$front->registerPlugin(new PageLayoutInitPlugin($this));
|
2014-04-24 22:19:55 +02:00
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
}
|
|
|
|
|