2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__."/configs/navigation.php";
|
|
|
|
require_once __DIR__."/configs/ACL.php";
|
2010-12-07 20:19:27 +01:00
|
|
|
|
|
|
|
require_once 'propel/runtime/lib/Propel.php';
|
2011-02-05 21:58:18 +01:00
|
|
|
Propel::init(__DIR__."/configs/airtime-conf.php");
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2011-04-20 06:46:03 +02:00
|
|
|
require_once __DIR__."/logging/Logging.php";
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__."/configs/constants.php";
|
|
|
|
require_once __DIR__."/configs/conf.php";
|
2010-12-07 20:19:27 +01:00
|
|
|
require_once 'DB.php';
|
|
|
|
|
2011-09-26 21:32:56 +02:00
|
|
|
require_once 'Preference.php';
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2011-08-12 21:36:00 +02:00
|
|
|
global $CC_CONFIG, $CC_DBC;
|
|
|
|
$dsn = $CC_CONFIG['dsn'];
|
|
|
|
|
|
|
|
$CC_DBC = DB::connect($dsn, FALSE);
|
|
|
|
if (PEAR::isError($CC_DBC)) {
|
|
|
|
echo "ERROR: ".$CC_DBC->getMessage()." ".$CC_DBC->getUserInfo()."\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
|
|
|
|
|
|
|
//DateTime in PHP 5.3.0+ need a default timezone set.
|
|
|
|
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
|
|
|
|
|
|
|
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
|
|
|
|
|
|
|
Zend_Validate::setDefaultNamespaces("Zend");
|
|
|
|
|
|
|
|
$front = Zend_Controller_Front::getInstance();
|
|
|
|
$front->registerPlugin(new RabbitMqPlugin());
|
|
|
|
|
|
|
|
|
|
|
|
/* The bootstrap class should only be used to initialize actions that return a view.
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initHeadLink()
|
|
|
|
{
|
|
|
|
$view = $this->getResource('view');
|
2011-04-18 17:02:09 +02:00
|
|
|
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css');
|
2011-04-18 17:02:09 +02:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css');
|
2011-11-14 06:34:53 +01:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css');
|
2011-08-23 18:45:03 +02:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/styles.css');
|
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initHeadScript()
|
|
|
|
{
|
|
|
|
$view = $this->getResource('view');
|
2011-04-18 17:02:09 +02:00
|
|
|
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
|
|
|
|
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.5.2.min.js','text/javascript');
|
2011-08-23 18:45:03 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.11.custom.min.js','text/javascript');
|
2011-04-18 17:02:09 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js','text/javascript');
|
2011-09-22 17:47:24 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip2.min.js','text/javascript');
|
2011-08-23 18:45:03 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js');
|
2011-09-30 20:46:09 +02:00
|
|
|
$view->headScript()->appendScript("var baseUrl='$baseUrl/'");
|
2011-01-31 05:05:49 +01:00
|
|
|
|
2011-02-01 17:43:52 +01:00
|
|
|
//scripts for now playing bar
|
2011-05-11 01:06:35 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js','text/javascript');
|
2011-08-23 18:45:03 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/playlist.js','text/javascript');
|
2011-11-14 06:34:53 +01:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js','text/javascript');
|
2011-02-01 17:43:52 +01:00
|
|
|
|
2011-04-18 17:02:09 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js','text/javascript');
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
protected function _initViewHelpers()
|
|
|
|
{
|
2011-02-03 23:51:35 +01:00
|
|
|
$view = $this->getResource('view');
|
2011-01-31 00:20:47 +01:00
|
|
|
$view->addHelperPath('../application/views/helpers', 'Airtime_View_Helper');
|
2011-01-30 22:47:11 +01:00
|
|
|
}
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
protected function _initTitle()
|
|
|
|
{
|
2011-02-03 23:51:35 +01:00
|
|
|
$view = $this->getResource('view');
|
2011-02-04 01:17:52 +01:00
|
|
|
$view->headTitle(Application_Model_Preference::GetHeadTitle());
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-08-22 16:12:53 +02:00
|
|
|
|
|
|
|
protected function _initZFDebug()
|
|
|
|
{
|
|
|
|
if (APPLICATION_ENV == "development"){
|
|
|
|
global $CC_DBC;
|
|
|
|
|
|
|
|
$autoloader = Zend_Loader_Autoloader::getInstance();
|
|
|
|
$autoloader->registerNamespace('ZFDebug');
|
|
|
|
|
|
|
|
$options = array(
|
|
|
|
'plugins' => array('Variables',
|
|
|
|
'Exception',
|
|
|
|
'Memory',
|
|
|
|
'Time')
|
|
|
|
);
|
|
|
|
$debug = new ZFDebug_Controller_Plugin_Debug($options);
|
|
|
|
|
|
|
|
$this->bootstrap('frontController');
|
|
|
|
$frontController = $this->getResource('frontController');
|
|
|
|
$frontController->registerPlugin($debug);
|
|
|
|
}
|
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
}
|
|
|
|
|