• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Loader_Autoloader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Loader_Autoloader的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_Autoloader类的具体用法?PHP Zend_Loader_Autoloader怎么用?PHP Zend_Loader_Autoloader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Loader_Autoloader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _initAutoloaderNamespaces

 public function _initAutoloaderNamespaces()
 {
     require_once APPLICATION_PATH . '/../library/vendor/Doctrine/lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
     $autoloader = \Zend_Loader_Autoloader::getInstance();
     $fmmAutoloader = new \Doctrine\Common\ClassLoader('Bisna');
     $autoloader->pushAutoloader(array($fmmAutoloader, 'loadClass'), 'Bisna');
 }
开发者ID:guilhermeblanco,项目名称:zendframework1-doctrine2,代码行数:7,代码来源:Bootstrap.php


示例2: init

 public function init()
 {
     $options = $this->getOptions();
     if (isset($options['base_path'])) {
         $autoloader = Zend_Loader_Autoloader::getInstance();
         $autoloader->registerNamespace('ZFDebug');
         $options = array('plugins' => array('Variables', 'File' => array('base_path' => $options['base_path']), 'Memory', 'Time', 'Registry', 'Exception'));
         # Instantiate the database adapter and setup the plugin.
         # Alternatively just add the plugin like above and rely on the autodiscovery feature.
         if ($this->hasPluginResource('db')) {
             $this->bootstrap('db');
             $db = $this->getPluginResource('db')->getDbAdapter();
             $options['plugins']['Database']['adapter'] = $db;
         }
         # Setup the cache plugin
         if ($this->hasPluginResource('cache')) {
             $this->bootstrap('cache');
             $cache = $this->getPluginResource('cache')->getDbAdapter();
             $options['plugins']['Cache']['backend'] = $cache->getBackend();
         }
         $debug = new ZFDebug_Controller_Plugin_Debug($options);
         $this->bootstrap('frontController');
         $frontController = $this->getResource('frontController');
         $frontController->registerPlugin($debug);
     }
 }
开发者ID:hausdesign,项目名称:zf-library,代码行数:26,代码来源:Zfdebug.php


示例3: _initAutoload

 protected function _initAutoload()
 {
     $moduleLoader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     $loader = Zend_Loader_Autoloader::getInstance();
     $loader->registerNamespace(array('Flux_', 'Iste_', 'Spip_'));
     return $moduleLoader;
 }
开发者ID:samszo,项目名称:open-edition,代码行数:7,代码来源:Bootstrap.php


示例4: _initAutoLoader

 /**
  * _initAutoLoader
  *
  * @return Zend_Loader_Autoloader
  */
 public function _initAutoLoader()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => 'Application', 'resourceTypes' => array('plugin' => array('path' => 'plugins/', 'namespace' => 'Plugin'), 'form' => array('path' => 'forms/', 'namespace' => 'Form'), 'model' => array('path' => 'models/', 'namespace' => 'Model'))));
     $autoloader->pushAutoloader($resourceLoader);
     return $autoloader;
 }
开发者ID:BGCX261,项目名称:zlayer-svn-to-git,代码行数:12,代码来源:Bootstrap.php


示例5: run

 public static function run()
 {
     #echo get_include_path();
     #exit();
     try {
         // 設定ファイル読み込み
         $config = new Zend_Config_Ini(INSTALL_DIR . 'application/configs/config.ini', 'production');
         // Zend_Loader の設定(ファイル自動読み込み)
         require_once 'Zend/Loader/Autoloader.php';
         $loader = Zend_Loader_Autoloader::getInstance();
         $loader->setFallbackAutoloader(true);
         Zend_Registry::set($config->registry->config, $config);
         $view = new Tokyofr_View_Smarty($config->smarty->template_dir, $config->smarty->toArray());
         $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
         $viewRenderer->setView($view)->setViewBasePathSpec($view->getEngine()->template_dir[0]);
         $viewRenderer->setViewScriptPathSpec(':controller/:action.:suffix');
         $viewRenderer->setViewScriptPathNoControllerSpec(':action.:suffix');
         $viewRenderer->setViewSuffix('phtml');
         Tokyofr_Controller_Front::run($config->path->controller);
     } catch (Zend_Exception $e) {
         //var_dump($e->getMessage());
         exit("error.");
     } catch (Exception $e) {
         //var_dump($e->getMessage());
         exit('error02');
     }
 }
开发者ID:namerows,项目名称:sandbox,代码行数:27,代码来源:Bootstrap.php


示例6: _initDoctrine

 protected function _initDoctrine()
 {
     require_once LIBRARY_PATH . '/Doctrine/Common/ClassLoader.php';
     $autoloader = \Zend_Loader_Autoloader::getInstance();
     $fmmAutoloader = new \Doctrine\Common\ClassLoader();
     $autoloader->pushAutoloader(array($fmmAutoloader, 'loadClass'));
     $options = $this->getOptions();
     $config = new Doctrine\ORM\Configuration();
     $config->addCustomDatetimeFunction('YEAR', 'Doctrine\\Extensions\\Query\\Mysql\\Year');
     $config->addCustomDatetimeFunction('MONTH', 'Doctrine\\Extensions\\Query\\Mysql\\Month');
     $config->addCustomDatetimeFunction('DAY', 'Doctrine\\Extensions\\Query\\Mysql\\Day');
     $config->addCustomStringFunction('DATEDIFF', 'Doctrine\\Extensions\\Query\\Mysql\\DateDiff');
     $config->addCustomStringFunction('DATE_FORMAT', 'Doctrine\\Extensions\\Query\\Mysql\\DateFormat');
     $config->addCustomStringFunction('IF', 'Doctrine\\Extensions\\Query\\Mysql\\IfElse');
     $config->addCustomStringFunction('GROUP_CONCAT', 'Doctrine\\Extensions\\Query\\Mysql\\GroupConcat');
     $config->addCustomStringFunction('IFNULL', 'Doctrine\\Extensions\\Query\\Mysql\\IfNull');
     $config->setProxyDir($options['doctrine']['metadata']['proxyDir']);
     $config->setProxyNamespace('Doctrine\\Proxy');
     $config->setAutoGenerateProxyClasses(true);
     $config->setAutoGenerateProxyClasses(APPLICATION_ENV == 'development');
     //$driverImpl = $config->newDefaultAnnotationDriver($options['metadata']['entityDir']);
     $driverImpl = new Doctrine\ORM\Mapping\Driver\YamlDriver($options['doctrine']['metadata']['entityDir']);
     $config->setMetadataDriverImpl($driverImpl);
     $cache = new Doctrine\Common\Cache\ArrayCache();
     $config->setMetadataCacheImpl($cache);
     $config->setQueryCacheImpl($cache);
     $evm = new Doctrine\Common\EventManager();
     $em = Doctrine\ORM\EntityManager::create($options['doctrine']['db'], $config, $evm);
     Zend_Registry::set('doctrine', $em);
     return $em;
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:31,代码来源:Bootstrap.php


示例7: _initCustomUrls

 protected function _initCustomUrls()
 {
     $this->bootstrap('frontController');
     Zend_Loader_Autoloader::getInstance()->registerNamespace('Customurl')->registerNamespace('Customurl');
     $plugin = new Customurl_ControllerPlugin();
     $this->getResource('frontController')->registerPlugin($plugin);
 }
开发者ID:EvanDotPro,项目名称:cosmos,代码行数:7,代码来源:Bootstrap.php


示例8: init

 public static function init($_host, $_user, $_pass, $dbname)
 {
     if (!isset($_host)) {
         $_host = SJB_System::getSystemSettings('DBHOST');
     }
     if (!isset($_user)) {
         $_user = SJB_System::getSystemSettings('DBUSER');
     }
     if (!isset($_pass)) {
         $_pass = SJB_System::getSystemSettings('DBPASSWORD');
     }
     if (!isset($dbname)) {
         $dbname = SJB_System::getSystemSettings('DBNAME');
     }
     $loader = Zend_Loader_Autoloader::getInstance();
     $loader->registerNamespace('Zend');
     $db = new Adapter(array('driver' => self::getDBAdapter(), 'host' => $_host, 'database' => $dbname, 'username' => $_user, 'password' => $_pass, 'options' => array('buffer_results' => true)));
     try {
         $connection = $db->driver->getConnection();
         $connection->connect();
         $sql = new Sql($db);
         Zend_Registry::set('db', $db);
         Zend_Registry::set('sql', $sql);
     } catch (Exception $ex) {
         die("Could not connect to database");
     }
     $db->createStatement("SET NAMES '" . SJB_System::getSystemSettings('MYSQL_CHARSET') . "'")->execute();
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:DB.php


示例9: __construct

 public function __construct($addr = "127.0.0.1", $port = 8080)
 {
     $this->port = $port;
     $this->addr = $addr;
     // Setup basic stuff
     error_reporting(E_ALL & ~E_NOTICE);
     $base = realpath(dirname(__FILE__) . '/../');
     $paths = array('.', realpath($base . '/library'), get_include_path());
     $this->base = $base;
     // Setup autoloading ...
     set_include_path(implode(PATH_SEPARATOR, $paths));
     require_once 'Zend/Loader/Autoloader.php';
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('EvHttp_');
     $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => realpath($base . '/application'), 'namespace' => '', 'resourceTypes' => array('model' => array('namespace' => 'Model', 'path' => 'models/'), 'api' => array('namespace' => 'Service', 'path' => 'apis/'))));
     // Load config
     $this->config = new Zend_Config_Ini($this->base . '/deploy/config.ini', 'default');
     Zend_Registry::set('config', $this->config);
     // Connect database
     $dbType = $this->config->database->type;
     $params = $this->config->database->toArray();
     $db = Zend_Db::factory($dbType, $params);
     Zend_Db_Table::setDefaultAdapter($db);
     Zend_Registry::set('db', $db);
     // Setup Xml-Rpc Server
     $this->xmlrpc_server = new Zend_XmlRpc_Server();
     $this->xmlrpc_server->setClass('Service_Poll', 'poll');
     Zend_XmlRpc_Server_Fault::attachFaultException('Exception');
     // Setup Json-Rpc Server
     $this->jsonrpc_server = new Zend_Json_Server();
     $this->jsonrpc_server->setClass('Service_Poll', 'poll')->setAutoEmitResponse(false)->setTarget('/jsonrpc')->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
 }
开发者ID:dreamsxin,项目名称:Kellner,代码行数:32,代码来源:main.php


示例10: init

 /**
  * Initializes the Doctrine Resource. This is done in four steps:
  * <ul>
  *  <li>Register Doctrines own autoloader with the Zend_Loader stack</li>
  *  <li>Instantiate the Doctrine_Manager</li>
  *  <li>Open defined connections</li>
  *  <li>Load model paths</li>
  * </ul>
  * @return Doctrine_Manager
  */
 public function init()
 {
     // Get the Resource options
     $options = $this->getOptions();
     // Register the Doctrine autoloader
     require_once 'Doctrine.php';
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->pushAutoloader(array('Doctrine', 'autoload'));
     $autoloader->pushAutoloader(array('Doctrine_Core', 'modelsAutoload'));
     // Initialize the Doctrine Manager
     $this->_manager = Doctrine_Manager::getInstance();
     // Check for manager attributes in the options
     if (array_key_exists('manager', $options)) {
         $managerOptions = $options['manager'];
         if (array_key_exists('attributes', $managerOptions) && is_array($managerOptions['attributes'])) {
             $this->_setManagerAttributes($managerOptions['attributes']);
         }
     }
     // Open defined connections
     if (isset($options['connections']) && is_array($options['connections']) && !empty($options['connections'])) {
         foreach ($options['connections'] as $connectionName => $connectionOptions) {
             $this->_openConnection($connectionName, $connectionOptions);
         }
     }
     // Load models
     if (array_key_exists('paths', $options)) {
         $pathsOptions = $options['paths'];
         if (array_key_exists('models_path', $pathsOptions) && !empty($pathsOptions['models_path'])) {
             $this->_loadModels($pathsOptions['models_path']);
         }
     }
     return $this->_manager;
 }
开发者ID:jtietema,项目名称:Fizzy,代码行数:43,代码来源:Doctrine.php


示例11: _initZFDebug

 protected function _initZFDebug()
 {
     // Setup autoloader with namespace
     $autoloader = \Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('ZFDebug');
     // Ensure the front controller is initialized
     $this->bootstrap('FrontController');
     // Retrieve the front controller from the bootstrap registry
     $front = $this->getResource('FrontController');
     // Only enable zfdebug if options have been specified for it
     if ($this->hasOption('zfdebug')) {
         // Create ZFDebug instance
         $zfDebug = new \ZFDebug\Controller\Plugin\Debug($this->getOption('zfdebug'));
         // Register ZFDebug with the front controller
         $front->registerPlugin($zfDebug);
     }
     // In application.ini do the following:
     //
     // [development : production]
     // zfdebug.plugins.Variables = null
     // zfdebug.plugins.Time = null
     // zfdebug.plugins.Memory = null
     // ...
     // Plugins that take objects as parameters like Database and Cache
     // need to be registered manually:
     $zfDebug->registerPlugin(new \ZFDebug\Controller\Plugin\Debug\Plugin\Database($db));
     // Alternative configuration without application.ini
     $options = ['plugins' => ['variables', 'database', 'file' => ['basePath' => '/Library/WebServer/Documents/budget', 'myLibrary' => 'Scienta'], 'memory', 'time', 'registry', 'exception']];
     $zfDebug = new \ZFDebug\Controller\Plugin\Debug($options);
     // Register ZFDebug with the front controller
     $front->registerPlugin($zfDebug);
 }
开发者ID:tavy315,项目名称:zfdebug,代码行数:32,代码来源:Zend_Application_Bootstrap.php


示例12: bootstrap

 public function bootstrap($env)
 {
     putenv('RUN_CLI_MODE=true');
     define('RUN_CLI_MODE', true);
     defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../../../../application'));
     // Define application environment
     defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : $env);
     // bootstrap include_path and constants
     require realpath(APPLICATION_PATH . '/../library/library.php');
     /** Zend_Application */
     require_once 'Zend/Application.php';
     require_once 'Centurion/Application.php';
     require_once 'Zend/Loader/Autoloader.php';
     $autoloader = Zend_Loader_Autoloader::getInstance()->registerNamespace('Centurion_')->setDefaultAutoloader(create_function('$class', "include str_replace('_', '/', \$class) . '.php';"));
     $classFileIncCache = realpath(APPLICATION_PATH . '/../data/cache') . '/pluginLoaderCache.tmp';
     if (file_exists($classFileIncCache)) {
         $fp = fopen($classFileIncCache, 'r');
         flock($fp, LOCK_SH);
         $data = file_get_contents($classFileIncCache);
         flock($fp, LOCK_UN);
         fclose($fp);
         $data = @unserialize($data);
         if ($data !== false) {
             Centurion_Loader_PluginLoader::setStaticCachePlugin($data);
         }
     }
     Centurion_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
     // Create application, bootstrap, and run
     $this->_application = new Centurion_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/');
     $this->_application->bootstrap('db');
     $this->_application->bootstrap('FrontController');
     $this->_application->bootstrap('contrib');
 }
开发者ID:rom1git,项目名称:Centurion,代码行数:33,代码来源:Install.php


示例13: init

 /**
  * Initialize
  */
 public function init()
 {
     $doctrineConfig = $this->getOptions();
     if (isset($doctrineConfig['compiled']) && $doctrineConfig['compiled'] == true && file_exists(APPLICATION_PATH . '/../library/Doctrine.compiled.php')) {
         require_once 'Doctrine.compiled.php';
     } else {
         require_once 'Doctrine.php';
     }
     $loader = Zend_Loader_Autoloader::getInstance();
     $loader->pushAutoloader(array('Doctrine', 'autoload'), 'Doctrine');
     $manager = Doctrine_Manager::getInstance();
     // set models to be autoloaded and not included (Doctrine::MODEL_LOADING_AGGRESSIVE)
     $manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
     // enable ModelTable classes to be loaded automatically
     $manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);
     // enable validation on save()
     $manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);
     // enable sql callbacks to make SoftDelete and other behaviours work transparently
     $manager->setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, true);
     // enable automatic queries resource freeing
     $manager->setAttribute(Doctrine_Core::ATTR_AUTO_FREE_QUERY_OBJECTS, true);
     // connect to database
     $manager->openConnection($doctrineConfig['connection_string']);
     // set to utf8
     $manager->connection()->setCharset('utf8');
     if (isset($doctrineConfig['cache']) && $doctrineConfig['cache'] == true) {
         $cacheDriver = new Doctrine_Cache_Apc();
         $manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
     }
     return $manager;
 }
开发者ID:abtris,项目名称:zf-doctrine,代码行数:34,代码来源:Doctrine.php


示例14: __connect

 public function __connect()
 {
     set_include_path(implode(PATH_SEPARATOR, array(WWW_ROOT . '/zend/library/', get_include_path())));
     require_once 'Zend/Loader/Autoloader.php';
     Zend_Loader_Autoloader::getInstance();
     $this->mail = new Zend_Mail_Storage_Imap(array('host' => $this->hostname, 'port' => $this->port, 'ssl' => $this->ssl, 'user' => $this->username, 'password' => $this->password));
 }
开发者ID:juliushermosura,项目名称:globeloop,代码行数:7,代码来源:MessagesController.php


示例15: _initAutoloader

 protected function _initAutoloader()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('PHPExcel_');
     $autoloader->registerNamespace('PHPExcel');
     return $autoloader;
 }
开发者ID:andrelotto,项目名称:EmailMarketing,代码行数:7,代码来源:Bootstrap.php


示例16: __construct

 /**
  * Constructor
  *
  * Initialize application. Potentially initializes include_paths, PHP
  * settings, and bootstrap class.
  *
  * @param  string                   $environment
  * @param  string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options
  * @param bool $suppressNotFoundWarnings Should warnings be suppressed when a file is not found during autoloading?
  * @throws Zend_Application_Exception When invalid options are provided
  * @return void
  */
 public function __construct($environment, $options = null, $suppressNotFoundWarnings = null)
 {
     $this->_environment = (string) $environment;
     $this->_autoloader = Zend_Loader_Autoloader::getInstance();
     $this->_autoloader->suppressNotFoundWarnings($suppressNotFoundWarnings);
     if (null !== $options) {
         if (is_string($options)) {
             $options = $this->_loadConfig($options);
         } elseif ($options instanceof Zend_Config) {
             $options = $options->toArray();
         } elseif (!is_array($options)) {
             throw new Zend_Application_Exception('Invalid options provided; must be location of config file,' . ' a config object, or an array');
         }
         $this->setOptions($options);
     }
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:28,代码来源:Application.php


示例17: _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']);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:32,代码来源:Bootstrap.php


示例18: setAdapter

 /**
  * Set adapter to use
  * 
  * @param  mixed $adapters 
  * @param  bool $force 
  * @return void
  */
 public static function setAdapter($adapters = null, $force = false)
 {
     $adapters = (array) $adapters;
     if (!$force) {
         $adapters = array_unique(array_merge($adapters, array(self::ADAPTER_GD, self::ADAPTER_IMAGEMAGICK)));
     }
     $name = null;
     foreach ($adapters as $adapter) {
         if (Zend_Loader_Autoloader::autoload($adapter)) {
             if (call_user_func($adapter . '::isAvailable')) {
                 $name = $adapter;
                 break;
             }
         } elseif (Zend_Loader_Autoloader::autoload('Zend_Image_Adapter_' . $adapter)) {
             if (call_user_func('Zend_Image_Adapter_' . $adapter . '::isAvailable')) {
                 $name = 'Zend_Image_Adapter_' . $adapter;
                 break;
             }
         } else {
             require_once 'Zend/Image/Exception.php';
             throw new Zend_Image_Exception("Could not find adapter '" . $adapter . "'");
         }
     }
     if ($name) {
         self::$_adapterToUse = $name;
         return $name;
     }
     require_once 'Zend/Image/Exception.php';
     throw new Zend_Image_Exception('Was not able to detect an available adapter');
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:37,代码来源:Image.php


示例19: init

 public function init()
 {
     //get ini file options
     $iniOptions = $this->getOptions();
     //set ZFDebug to autoload
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('ZFDebug');
     //initialized Front Controller
     $bootstrap = $this->getBootstrap();
     $bootstrap->bootstrap('frontController');
     $frontController = $bootstrap->getResource('frontController');
     if (RFLib_Core::getIsDeveloperMode() && trim($iniOptions['enable'])) {
         //set ZFDebug options
         $options = array('plugins' => array('Variables', 'File' => array('basePath' => APPLICATION_PATH . '/..'), 'Memory', 'Time', 'Registry', 'Exception'));
         //add cache option if specified
         if ($bootstrap->hasPluginResource('cache')) {
             $bootstrap->bootstrap('cache');
             $cache = $bootstrap->getPluginResource('cache')->getBackend();
             $options['plugins']['Cache']['backend'] = $cache;
         }
         // add db option if specified
         if ($bootstrap->hasPluginResource('db')) {
             $bootstrap->bootstrap('db');
             $db = $bootstrap->getPluginResource('db')->getDbAdapter();
             $options['plugins']['Database']['adapter'] = $db;
         }
         $debug = new ZFDebug_Controller_Plugin_Debug($options);
         $frontController->registerPlugin($debug);
     }
 }
开发者ID:rickyfeng,项目名称:wenda,代码行数:30,代码来源:ZFDebug.php


示例20: getZfdebug

 /**
  * Get Zfdebug
  * 
  * @return ZFDebug_Controller_Plugin_Debug
  */
 public function getZfdebug()
 {
     if (null === $this->_zfdebug) {
         $this->getBootstrap()->bootstrap('Session');
         // Get Zfdebug configuration options from the application.ini file
         $zfdebugConfig = $this->getOptions();
         if ($zfdebugConfig['enabled']) {
             $autoloader = Zend_Loader_Autoloader::getInstance();
             $autoloader->registerNamespace('ZFDebug');
             $options = array('plugins' => $zfdebugConfig['plugins']);
             # Instantiate the database adapter and setup the plugin.
             # Alternatively just add the plugin like above and rely on the autodiscovery feature.
             if ($this->getBootstrap()->hasPluginResource('db')) {
                 $this->getBootstrap()->bootstrap('db');
                 $db = $this->getBootstrap()->getPluginResource('db')->getDbAdapter();
                 $options['plugins']['Database']['adapter'] = $db;
             }
             # Setup the cache plugin
             if ($this->getBootstrap()->hasPluginResource('cache')) {
                 $this->getBootstrap()->bootstrap('cache');
                 $cache = $this->getBootstrap()->getPluginResource('cache')->getDbAdapter();
                 $options['plugins']['Cache']['backend'] = $cache->getBackend();
             }
             $this->getBootstrap()->bootstrap('OSSAutoLoader');
             $this->getBootstrap()->bootstrap('Doctrine');
             $options['plugins']['OSS_ZFDebug_Controller_Plugin_Debug_Plugin_Doctrine']['manager'] = $this->getBootstrap()->getResource('Doctrine');
             $this->_zfdebug = new ZFDebug_Controller_Plugin_Debug($options);
             $this->getBootstrap()->bootstrap('FrontController');
             $frontController = $this->getBootstrap()->getResource('FrontController');
             $frontController->registerPlugin($this->_zfdebug);
         }
     }
     return $this->_zfdebug;
 }
开发者ID:opensolutions,项目名称:oss-framework,代码行数:39,代码来源:Zfdebug.php



注:本文中的Zend_Loader_Autoloader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Loader_Autoloader_Resource类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Loader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap