/** * constructor * * YOU SHOULD NOT OVERRIDE THIS, unless you know what you are doing * */ public function __construct() { // initialize the ZF Contexts (only once per php request) if (!self::$_isInitialized) { $contextRegistry = Zend_Tool_Project_Context_Repository::getInstance(); $contextRegistry->addContextsFromDirectory(dirname(dirname(__FILE__)) . '/Context/Zf/', 'Zend_Tool_Project_Context_Zf_'); self::$_isInitialized = true; } // load up the extending providers required context classes if ($contextClasses = $this->getContextClasses()) { $this->_loadContextClassesIntoRegistry($contextClasses); } }
public function initialize() { // initialize the ZF Contexts (only once per php request) if (!self::$_isInitialized) { // load all base contexts ONCE $contextRegistry = Zend_Tool_Project_Context_Repository::getInstance(); $contextRegistry->addContextsFromDirectory(dirname(dirname(__FILE__)) . '/Context/Zf/', 'Zend_Tool_Project_Context_Zf_'); $contextRegistry->addContextsFromDirectory(dirname(dirname(__FILE__)) . '/Context/Filesystem/', 'Zend_Tool_Project_Context_Filesystem_'); // determine if there are project specfic providers ONCE $profilePath = $this->_findProfileDirectory(); if ($this->_hasProjectProviderDirectory($profilePath . DIRECTORY_SEPARATOR . '.zfproject.xml')) { $profile = $this->_loadProfile(); // project providers directory resource $ppd = $profile->search('ProjectProvidersDirectory'); $ppd->loadProviders($this->_registry); } self::$_isInitialized = true; } // load up the extending providers required context classes if ($contextClasses = $this->getContextClasses()) { $this->_loadContextClassesIntoRegistry($contextClasses); } }