本文整理汇总了PHP中Zend_Loader_PluginLoader类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_PluginLoader类的具体用法?PHP Zend_Loader_PluginLoader怎么用?PHP Zend_Loader_PluginLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Loader_PluginLoader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$registry = Zend_Registry::getInstance();
$config = $registry->get("config");
$sysCache = $registry->get("sysCache");
$cacheFiles = new Ml_Cache_Files($sysCache);
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers');
$frontController = $this->getBootstrap()->getResource('FrontController');
$dispatcher = $frontController->getDispatcher();
$request = $frontController->getRequest();
$router = $frontController->getRouter();
$router->removeDefaultRoutes();
//@todo remove this patched route module and use the original instead ASAP
$compat = new Ml_Controller_Router_Route_Module(array(), $dispatcher, $request);
$router->addRoute("default", $compat);
$routerConfig = $cacheFiles->getConfigIni(APPLICATION_PATH . '/configs/' . HOST_MODULE . 'Routes.ini');
$router->addConfig($routerConfig, "routes");
$frontController->registerPlugin(new Ml_Plugins_ReservedUsernames());
Zend_Controller_Action_HelperBroker::getStaticHelper("Redirector")->setPrependBase(false);
$frontController->setBaseUrl($config['webroot']);
$loader = new Zend_Loader_PluginLoader();
$loader->addPrefixPath('Zend_View_Helper', EXTERNAL_LIBRARY_PATH . '/Zend/View/Helper/')->addPrefixPath('Ml_View_Helper', APPLICATION_PATH . '/views/helpers');
$classFileIncCache = CACHE_PATH . '/PluginDefaultLoaderCache.php';
if (file_exists($classFileIncCache)) {
require $classFileIncCache;
}
Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->initView();
}
示例2: _loadAclClasses
/**
* Load ACL classes from Brightfame Framework
*
* @return void
*/
protected function _loadAclClasses()
{
$loader = new Zend_Loader_PluginLoader(array('Brightfame_Acl_Role' => APPLICATION_PATH . '/../library/Brightfame/Acl/Role/'));
foreach (array('Guest', 'Member', 'Administrator') as $role) {
$loader->load($role);
}
}
示例3: getLoader
public function getLoader()
{
if ($this->_loader == null) {
$this->_loader = new Zend_Loader_PluginLoader();
$this->_loader->addPrefixPath('Bc_Annotations', 'Bc/Annotations');
}
return $this->_loader;
}
示例4: _initPlugins
/**
* Load system module plugins
*/
public function _initPlugins()
{
$loader = new Zend_Loader_PluginLoader();
$loader->addPrefixPath('System_Plugin', 'application/modules/system/plugins/');
$this->bootstrap('frontController');
$front = $this->getResource('frontController');
$front->registerPlugin(new System_Plugin_Router());
}
示例5: getPluginLoader
/**
* Get plugin loader
*
* @return Zend_Loader_PluginLoader
*/
public function getPluginLoader()
{
if (null === $this->_loader) {
$this->_loader = new Zend_Loader_PluginLoader();
$this->_loader->addPrefixPath('Model_Table', dirname(__FILE__) . '/Table/');
}
return $this->_loader;
}
示例6: getPluginLoader
/**
* Get plugin loader
*
* @return Zend_Loader_PluginLoader_Interface
*/
public static function getPluginLoader()
{
if (self::$pluginLoader == null) {
$pluginLoader = new Zend_Loader_PluginLoader();
$pluginLoader->addPrefixPath(__CLASS__, 'System/Serializer/Dom');
self::$pluginLoader = $pluginLoader;
}
return self::$pluginLoader;
}
示例7: getPluginLoader
/**
* Get plugin loader
*
* @return Zend_Loader_PluginLoader_Interface
*/
public static function getPluginLoader()
{
if (self::$pluginLoader == null) {
$pluginLoader = new Zend_Loader_PluginLoader();
$pluginLoader->addPrefixPath(str_replace('Abstract', '', __CLASS__), dirname(__FILE__));
self::$pluginLoader = $pluginLoader;
}
return self::$pluginLoader;
}
示例8: getPluginLoader
/**
* Get plugin loader
*
* @return Zend_Loader_PluginLoader_Interface
*/
public static function getPluginLoader()
{
if (self::$pluginLoader == null) {
$pluginLoader = new Zend_Loader_PluginLoader();
$pluginLoader->addPrefixPath('System_Acl_Loader', 'System/Acl/Loader');
self::$pluginLoader = $pluginLoader;
}
return self::$pluginLoader;
}
示例9: _initPlugins
public function _initPlugins()
{
$this->bootstrap('frontController');
$pluginsLoader = new Zend_Loader_PluginLoader();
$pluginsLoader->addPrefixPath("Plugin", APPLICATION_PATH . '/plugins');
$pluginsLoader->load("PageModule");
if ($pluginsLoader->isLoaded('PageModule')) {
Zend_Controller_Front::getInstance()->registerPlugin(new Plugin_PageModule());
}
}
示例10: _initPlugins
protected function _initPlugins()
{
$this->bootstrap('frontController');
$pluginsLoader = new Zend_Loader_PluginLoader();
$pluginsLoader->addPrefixPath("Plugin", APPLICATION_PATH . '/plugins');
$front = Zend_Controller_Front::getInstance();
$pluginsLoader->load("Redirect");
if ($pluginsLoader->isLoaded("Redirect")) {
$front->registerPlugin(new Plugin_Redirect());
}
}
示例11: _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;
}
}
}
示例12: __construct
/**
* 构造函数
*
* @param string $backend
* @param string $frontend
* @throws ZtChart_Model_Assemble_Exception
*/
public function __construct($backend, $frontend = 'PHPArray')
{
$loader = new Zend_Loader_PluginLoader(array('ZtChart_Model_Assemble_Backend_' => realpath(__DIR__ . '/Assemble/Backend'), 'ZtChart_Model_Assemble_Frontend_' => realpath(__DIR__ . '/Assemble/Frontend')));
$backendName = is_array($backend) ? key($backend) : $backend;
if (false === ($backendClass = $loader->load($backendName, false))) {
throw new ZtChart_Model_Assemble_Exception("Specified backend class '{$backendName}' could not be found");
}
$this->_backend = new $backendClass($backend);
$frontendName = is_array($frontend) ? key($frontend) : $frontend;
if (false === ($frontendClass = $loader->load($frontendName, false))) {
throw new ZtChart_Model_Assemble_Exception("Specified frontend class '{$frontendName}' could not be found");
}
$this->_frontend = new $frontendClass($frontend);
}
示例13: init
/**
* To init the view
*
* @return Zend_View $view
*/
public function init()
{
$frontendOptions = array('automatic_serialization' => true, 'lifetime' => 86400);
$backendOptions = array('cache_dir' => PROJECT_ROOT . '/repository/cache/');
if ('development' == APPLICATION_ENV) {
$frontendOptions['caching'] = false;
//关闭缓存
} else {
$classFileIncCache = $backendOptions['cache_dir'] . 'pluginLoaderCache.php';
if (file_exists($classFileIncCache)) {
include_once $classFileIncCache;
}
Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
}
$this->_cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
Zend_Db_Table_Abstract::setDefaultMetadataCache($this->_cache);
//缓存Zend_Db_Table元数据
Zend_Date::setOptions(array('cache' => $this->_cache));
//缓存Zend_Date
Zend_Translate::setCache($this->_cache);
//缓存Zend_Translate
Zend_Registry::set('cache', $this->_cache);
// Return it, so that it can be stored by the bootstrap
return $this->_cache;
}
示例14: _initStatics
/**
*
* Kilka dodatkowych statycznych inicjaliacji
*
*/
public function _initStatics()
{
$config = $this->getApplication()->getOptions();
/**
* Ustawienie konfigu na rejestrze dla kompatybilnosci z poprzednmi rozwiazaniami (resouce plugin dla ACL)
*/
Zend_Registry::set('config', $config);
if (isset($config['general']['pluginloader']) and $config['general']['pluginloader']) {
$classFileIncCache = APPLICATION_PATH . '/../tmp/pluginLoaderCache.php';
if (file_exists($classFileIncCache)) {
include_once $classFileIncCache;
}
Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
}
/**
* Ustawienie fallback tak by klasy bez namespacu tez dzialaly
*/
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true)->pushAutoloader(NULL, 'Smarty_');
/**
* Domyslny rozmiar strony paginatora
*/
Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('/common/paginator_footer.phtml');
Zend_Controller_Action_HelperBroker::addPrefix('Base_Controller_Action_Helper');
Zend_Markup::addRendererPath('Logic', 'Logic/');
Base_Logic_Abstract::setUsePreexecuteHooks($config['general']['usepreexecutehooks']);
}
示例15: getTableLoader
/**
* Returns the table loader for this instance.
* @return Zend_Loader_PluginLoader
*/
protected function getTableLoader()
{
if (!isset($this->_tableLoader)) {
$this->_tableLoader = new Zend_Loader_PluginLoader();
$this->_tableLoader->addPrefixPath('Hmd_Db_Model_Table', 'Hmd/Db/Model/Table');
}
return $this->_tableLoader;
}