protected function _bootstrap() { //Now let's parse the module specific configuration //Path might change however this is probably the one you won't ever need to change... //And also don't forget to use the current staging environment by sending the APP_ENV parameter to the Zend_Config $_conf = new Zend_Config_Ini(APPLICATION_PATH . "/modules/" . strtolower($this->getModuleName()) . "/config/application.ini", APPLICATION_ENV); $this->_options = array_merge($this->_options, $_conf->toArray()); //Let's merge the both arrays so that we can use them together... parent::_bootstrap(); //Well our custom bootstrap logic should end with the actual bootstrapping, now that we have merged both configs, we can go on... }
public function __construct($application) { parent::__construct($application); if (isset($this->_file)) { // load config file $configFile = dirname($this->_file) . '/configs/config.php'; if (Zend_Loader::isReadable($configFile)) { // Set this bootstrap options $this->setOptions(include $configFile); } } }
public function __construct($application) { parent::__construct($application); require_once 'Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); $loaders = $loader->getAutoloaders(); foreach ($loaders as $l) { $l->addResourceType('cronjob', 'cronjobs/', 'Cronjob'); $l->addResourceType('apiendpoint', 'apiendpoints/', 'Apiendpoint'); } $loader->setFallbackAutoloader(true); }
public function __construct($application) { parent::__construct($application); // set config dir for this module $this->_configDir = $this->getResourceLoader()->getBasePath() . '/configs'; // load module-specific routes $this->_loadRoutes(); // register module configurator plugin which will call $this::onPreDispatch() on module access require_once 'Xzend/Controller/Plugin/ModuleConfigurator.php'; $configurator = new Xzend_Controller_Plugin_ModuleConfigurator(); $configurator->setModuleBootstrap($this); Zend_Controller_Front::getInstance()->registerPlugin($configurator); }
/** * This is used to allow for configurable boot orders */ protected function _bootstrap($resource = null) { // We can use boot order to resolve if (is_null($resource) && $this->hasOption('bootorder')) { $bootorder = (array) $this->getOption('bootorder'); ksort($bootorder); $bootorder = array_unique(array_merge(array_values($bootorder), $this->getClassResourceNames(), $this->getPluginResourceNames())); foreach ($bootorder as $resource) { $this->_executeResource($resource); } $this->postBootstrap(); } else { parent::_bootstrap($resource); if (is_null($resource)) { $this->postBootstrap(); } } }
/** * Constructor * * @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application * @return void */ public function __construct($application) { parent::__construct($application); $this->init(); }
public function __construct($application) { parent::__construct($application); $this->_loadInitializer(); }