/** * @see Zend_Application::setOptions() * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options * @return void */ public function __construct($environment, $options = null) { $cached = false; $cache = false; require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('Core'); require_once 'Doctrine/Common/ClassLoader.php'; $fmmAutoloader = new \Doctrine\Common\ClassLoader('Bisna'); $autoloader->pushAutoloader(array($fmmAutoloader, 'loadClass'), 'Bisna'); $fmmAutoloader = new \Doctrine\Common\ClassLoader('CrEOF'); $autoloader->pushAutoloader(array($fmmAutoloader, 'loadClass'), 'CrEOF'); if (is_string($options)) { $this->_filesRead[] = $options; if (self::hasCache()) { $cache = self::getCache(); $idCache = 'SICAe_Main_Application_Config'; $_options = self::_loadCache($idCache); if (count($_options)) { $cached = true; $options = $_options; unset($_options); } } } parent::__construct($environment, $options); if (false === $cached && $cache) { $options = $this->getOptions(); $data = array('options' => $options, 'filesRead' => array_unique($this->_filesRead)); $cache->save($data, $idCache); } }
public function __construct($environment, $options) { $optConfig = static::$optConfig; if (isset($options['optrules'])) { $optConfig = array_merge($optConfig, $options['optrules']); unset($options['optrules']); } $this->opts = new Zend_Console_Getopt($optConfig); $module = $this->getModule(); if ($module !== 'default') { $options['config'][] = APPLICATION_PATH . '/modules/' . $module . '/configs/module.ini'; } parent::__construct($environment, $options); try { $this->opts->parse(); } catch (Zend_Console_Getopt_Exception $e) { $this->error("Error parsing command line options: {$e->getMessage()}"); exit(1); } if ($this->opts->h) { $this->usage(); exit(0); } Zend_Registry::set('CliApplication', $this); }
/** * @description Constructor * @param string $environment * @param string|array $options * @param string $useCache * @param null|Zend_Cache_Core $configCache * @author Se# * @version 0.0.1 */ public function __construct($environment, $options = null, $useCache = 'production', Zend_Cache_Core $configCache = null) { if ($useCache && empty($configCache)) { $configCache = $this->_defaultConfigCache($useCache); } $this->_configCache = $configCache; parent::__construct($environment, $options); }
/** * Constructor * * @param string $environment * @param null|string|array $options */ public function __construct($environment, $options = null) { if (is_array($options) && isset($options['configFile'])) { if (isset($options['cacheOptions'])) { $this->_cacheOptions = $options['cacheOptions']; } $options = $options['configFile']; } parent::__construct($environment, $options); }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP * settings, and bootstrap class. * * @param $environment string * @param $options string|array|Zend_Config * String path to configuration file, or array/Zend_Config of * configuration options * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $options = null) { $this->initCache(); parent::__construct($environment, $options); //Zend_Loader_Autoloader::getInstance()->setDefaultAutoloader(array('MIIS_Bootstrap', 'autoload')); //$auth_cookie = $this->getOption('miis_app'); //if(isset($auth_cookie['auth']['use_cookie']) && $auth_cookie['auth']['use_cookie']){ // Zend_Auth::getInstance()->setStorage(new MIIS_Auth_Storage_Cookie())->getStorage()->setDomain($auth_cookie['cookie']['domain'])->setExpiration(0); //} }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP * settings, and bootstrap class. * * @param string $environment * @param string|array|Zend_Config $optionsOrRootDir String path to configuration file, or array/Zend_Config of configuration options * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $optionsOrRootDir = null) { if (is_string($optionsOrRootDir) && is_dir($optionsOrRootDir)) { $this->rootDir = $optionsOrRootDir; parent::__construct($environment, $this->rootDir . self::$configDir . '/application.common.ini'); } else { parent::__construct($environment, $optionsOrRootDir); } $this->getAutoloader()->registerNamespace('System_'); Zend_Registry::set(self::APPLICATION, $this); }
/** * Initialize the application. * * @param string $environment The environment name. * @param string|array|Zend_Config $options Application configuration. */ public function __construct($environment, $options = null) { // Add functions to the global scope. require_once 'globals.php'; // Set the configuration file if not passed. if (!$options) { $options = CONFIG_DIR . '/application.ini'; } parent::__construct($environment, $options); Zend_Registry::set('bootstrap', $this->getBootstrap()); }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP * settings, and bootstrap class. * * When $options is an array with a key of configFile, this will tell the * class to cache the configuration using the default options or cacheOptions * passed in. * * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $options = null) { if (is_array($options) && isset($options['configFile'])) { $this->_cacheConfig = true; // First, let's check to see if there are any cache options if (isset($options['cacheOptions'])) { $this->_cacheOptions = array_merge($this->_cacheOptions, $options['cacheOptions']); } $options = $options['configFile']; } parent::__construct($environment, $options); }
/** * Переопределенный конструктор класса. Загружает либо конфиг из файла, либо из кеша. * * @param $environment Окружение приложения. * @param null|array $options Массив опций. */ public function __construct($environment, $options = null) { $configPath = $options; if (isset($options['cachedConfigPath']) && isset($options['configPath'])) { $configPath = $this->_loadCachedConfig($options['configPath'], $options['cachedConfigPath']); } if (isset($options['pluginCache']) && !empty($options['pluginCache'])) { $this->_initPluginCache($options['pluginCache']); } parent::__construct($environment, $configPath); if (isset($options['cachedConfigPath']) && $configPath != $options['cachedConfigPath']) { $this->_saveCache($options['cachedConfigPath']); } }
/** * Initialize the application. * * @param string $environment The environment name. * @param string|array|Zend_Config $options Application configuration. */ public function __construct($environment, $options = null) { // Add functions to the global scope. require_once 'globals.php'; // Add CG35 functions to the global scope. require_once MASTER_PATH . '/application/libraries/cg35.php'; // Add CG35 PDF class to the global scope. require_once MASTER_PATH . '/application/libraries/Omeka/Pdf.php'; // Set the configuration file if not passed. if (!$options) { $options = CONFIG_DIR . '/application.ini'; } parent::__construct($environment, $options); Zend_Registry::set('bootstrap', $this->getBootstrap()); }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP * settings, and bootstrap class. * * It also loads the default config file for the HausDesign CMS. * * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config * of configuration options * @throws Zend_Application_Exception When invalid options are provided * @throws HausDesign_Application_Exception When invalid general options are provided * @return void */ public function __construct($environment, $options = null) { parent::__construct($environment, $options); $this->_parseUrl(); define('CUR_APPLICATION_PATH', realpath(APPLICATION_PATH . '' . DIRECTORY_SEPARATOR . '' . $this->_application . '' . DIRECTORY_SEPARATOR)); // Get the application specific file // Normally located at /application/*application name*/configs/application.ini $applicationOptions = array(); $applicationConfigFile = CUR_APPLICATION_PATH . '' . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'application.ini'; if (file_exists($applicationConfigFile)) { $applicationOptions = $this->_loadConfig($applicationConfigFile); } // Merge the options and force them into Zend_Application $this->setOptions($this->mergeOptions($this->getOptions(), $applicationOptions)); // Add the options to the Zend Registry Zend_Registry::set('config', $this->getOptions()); // FIX FOR IIS CACHE FOLDER START $config = new Zend_Config_Ini($applicationConfigFile, $environment); $cache = Zend_Cache::factory('Core', 'File', $config->resources->cachemanager->administrator->frontend->options->toArray(), $config->resources->cachemanager->administrator->backend->options->toArray()); Zend_Locale::setCache($cache); }
/** * Constructor * * @return void */ public function __construct() { // Call Zend_Application constructor parent::__construct(APPLICATION_ENV, $this->_getOptions()); }
/** * {@inheritdoc} * * Generate the path to the application settings based on the current * application environment. * * @param string $environment * @param string|array|Zend_Config $options Array/Zend_Config of configuration options * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $options = null) { \Zend_Loader_Autoloader::getInstance()->registerNamespace('Epixa\\')->registerNamespace('Zend_'); $options = array('config' => APPLICATION_ROOT . '/config/settings/' . APPLICATION_ENV . '.php'); parent::__construct($environment, $options); }
public function __construct($environment, $options, Zend_Cache_Core $configCache, $useCache) { $this->_configCache = $configCache; $this->_useCache = $useCache; parent::__construct($environment, $options); }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP settings, and bootstrap class * * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of * configuration options * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $options = null) { $this->_debug = $environment == 'development' ? true : false; $this->_rootDir = $this->getRootDir(); $this->_name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->_rootDir)); $this->_classes = array(); parent::__construct($environment, $options); }
/** * {@inheritdoc} * * Overridden to add ZendX and La namespace to autoloader * * @param string $environment * @param array $options */ public function __construct($environment, $options = null) { require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance()->registerNamespace('La')->registerNamespace('Zebra')->registerNamespace('ZendX'); parent::__construct($environment, $options); }