/** * 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 = Context\Repository::getInstance(); $contextRegistry->addContextsFromDirectory(dirname(__DIR__) . '/Context/Zf/', 'Zend\\Tool\\Project\\Context\\Zf\\'); $contextRegistry->addContextsFromDirectory(dirname(__DIR__) . '/Context/Filesystem/', 'Zend\\Tool\\Project\\Context\\Filesystem\\'); 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 = Context\Repository::getInstance(); $contextRegistry->addContextsFromDirectory(dirname(__DIR__) . '/Context/Zf/', 'Zend\\Tool\\Project\\Context\\Zf\\'); $contextRegistry->addContextsFromDirectory(dirname(__DIR__) . '/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); } }