本文整理匯總了PHP中Zend_Loader_PluginLoader::loadAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Loader_PluginLoader::loadAll方法的具體用法?PHP Zend_Loader_PluginLoader::loadAll怎麽用?PHP Zend_Loader_PluginLoader::loadAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Loader_PluginLoader
的用法示例。
在下文中一共展示了Zend_Loader_PluginLoader::loadAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
public function load()
{
$loadedClasses = $this->_pluginLoader->loadAll();
foreach ($loadedClasses as $className) {
$reflector = new ReflectionClass($className);
if ($reflector->isInstantiable() && $reflector->isSubclassOf('Zend_Tool_Provider_Abstract')) {
$this->addProvider($reflector->newInstance());
continue;
}
if ($reflector->isInstantiable() && ($reflector->getName() == 'Zend_Tool_Provider_Action' || $reflector->isSubclassOf('Zend_Tool_Provider_Action'))) {
$this->addAction($reflector->newInstance());
continue;
}
}
return $this;
}
示例2: _loadContexts
/**
* _loadContexts() - statically find and load the context files
*
*/
protected static function _loadContexts()
{
$pluginLoader = new Zend_Loader_PluginLoader(array('Zend_Tool_Provider_ZfProject_ProjectContext_' => dirname(__FILE__) . '/ProjectContext/'));
$classes = $pluginLoader->loadAll();
foreach ($classes as $class) {
$reflectionClass = new ReflectionClass($class);
if ($reflectionClass->isInstantiable() && $reflectionClass->isSubclassOf('Zend_Tool_Provider_ZfProject_ProjectContext_ProjectContextAbstract')) {
$context = $reflectionClass->newInstance();
self::$_contexts[$context->getContextName()] = $context;
}
}
}