Esempio n. 1
0
require_once __DIR__ . "/configs/conf.php";
$CC_CONFIG = Config::getConfig();
require_once __DIR__ . "/configs/ACL.php";
require_once 'propel/runtime/lib/Propel.php';
Propel::init(__DIR__ . "/configs/airtime-conf-production.php");
require_once __DIR__ . "/configs/constants.php";
require_once 'Preference.php';
require_once 'Locale.php';
require_once "DateHelper.php";
require_once "OsPath.php";
require_once "Database.php";
require_once "Timezone.php";
require_once __DIR__ . '/forms/helpers/ValidationTypes.php';
require_once __DIR__ . '/controllers/plugins/RabbitMqPlugin.php';
require_once APPLICATION_PATH . "/logging/Logging.php";
Logging::setLogPath('/var/log/airtime/zendphp.log');
Config::setAirtimeVersion();
require_once __DIR__ . "/configs/navigation.php";
Zend_Validate::setDefaultNamespaces("Zend");
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new RabbitMqPlugin());
//localization configuration
Application_Model_Locale::configureLocalization();
/* The bootstrap class should only be used to initialize actions that return a view.
   Actions that return JSON will not use the bootstrap class! */
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
{
    // Need to check that we are superuser before running this.
    if (posix_geteuid() != 0) {
        echo "Must be root user.\n";
        exit(1);
    }
}
exitIfNotRoot();
date_default_timezone_set("UTC");
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
require_once $CC_CONFIG['phpDir'] . '/application/configs/conf.php';
$CC_CONFIG = Config::getConfig();
require_once $CC_CONFIG['phpDir'] . '/application/configs/constants.php';
require_once $CC_CONFIG['phpDir'] . '/application/logging/Logging.php';
Logging::setLogPath("/var/log/airtime/zendphp.log");
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(get_include_path(), realpath($CC_CONFIG['phpDir'] . '/library'), realpath($CC_CONFIG['phpDir']), realpath($CC_CONFIG['phpDir'] . '/application/models'))));
require_once 'propel/runtime/lib/Propel.php';
Propel::init($CC_CONFIG['phpDir'] . "/application/configs/airtime-conf-production.php");
//Zend framework
if (file_exists('/usr/share/php/libzend-framework-php')) {
    set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
}
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Application_');
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => $CC_CONFIG['phpDir'] . '/' . 'application', 'namespace' => 'Application', 'resourceTypes' => array('model' => array('path' => 'models/', 'namespace' => 'Model'), 'common' => array('path' => 'common/', 'namespace' => 'Common'))));
$infoArray = Application_Model_Preference::GetSystemInfo(true);
if (Application_Model_Preference::GetSupportFeedback() == '1') {
    $url = 'http://stat.sourcefabric.org/index.php?p=airtime';