当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Front::addModuleDirectory方法代码示例

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


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

示例1: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->basePath = realpath(__DIR__ . str_repeat(DIRECTORY_SEPARATOR . '..', 2));
     $this->request = new \Zend\Controller\Request\Http();
     $this->response = new \Zend\Controller\Response\Http();
     $this->front = \Zend\Controller\Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory($this->basePath . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'modules')->setRequest($this->request)->setResponse($this->response);
     $this->helper = new Helper\ViewRenderer();
     HelperBroker::addHelper($this->helper);
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:17,代码来源:ViewRendererTest.php

示例2: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->basePath = realpath(dirname(__FILE__) . str_repeat(DIRECTORY_SEPARATOR . '..', 2));
     $this->request = new Zend_Controller_Request_Http();
     $this->response = new Zend_Controller_Response_Http();
     $this->front = Zend_Controller_Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory($this->basePath . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'modules')->setRequest($this->request)->setResponse($this->response);
     $this->helper = new Zend_Controller_Action_Helper_ViewRenderer();
     Zend_Controller_Action_HelperBroker::addHelper($this->helper);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:17,代码来源:ViewRendererTest.php

示例3: __construct

 /**
  * Sets up all the initial required pieces of the app.
  * 
  * @param string $environment
  * @param string $appPath
  * @param string $moduleDir
  */
 public function __construct($environment, $appPath = APPLICATION_PATH, $moduleDir = 'modules')
 {
     // set the environment
     $this->_environment = (string) $environment;
     // set the application path
     $this->_appPath = $appPath;
     // set the modules dir path
     $this->_moduleDir = $this->_appPath . DIRECTORY_SEPARATOR . $moduleDir;
     // initiate autoloader
     require_once 'Zend/Loader/Autoloader.php';
     $this->_autoloader = Zend_Loader_Autoloader::getInstance();
     // set up module autoloading
     $this->_autoloader->pushAutoloader(array($this, 'moduleAutoload'));
     // set front controller
     $this->_front = Zend_Controller_Front::getInstance();
     // add module directory
     $this->_front->addModuleDirectory($this->_moduleDir);
     // initiate request
     if ($this->_request === null) {
         $this->_request = new Zend_Controller_Request_Http();
     }
     // initiate response
     if ($this->_response === null) {
         $this->_response = new Zend_Controller_Response_Http();
     }
     // initiate router (Zend_Controller_Router_Rwrite)
     $this->_router = $this->_front->getRouter();
     // get application.ini options
     $appOptions = $this->_getApplicationOptions();
     // set routes in router from application.ini (if any)
     $this->_addRoutesFromConfig($appOptions);
     // update request with routes
     $this->_route($this->_request);
     // get module options
     $moduleOptions = $this->_getModuleOptions();
     // merge application and module options into one array
     $options = $this->mergeOptions($appOptions, $moduleOptions);
     // set options
     $this->setOptions($options);
     // update front controller request
     $this->_front->setRequest($this->_request);
     // update front controller response
     $this->_front->setResponse($this->_response);
     // to be used in dispatch
     $this->_front->setRouter($this->_router);
 }
开发者ID:riteshsahu1981,项目名称:Weadvance,代码行数:53,代码来源:App.php

示例4: initCustomModules

 /**
  * Add modules
  */
 public function initCustomModules()
 {
     if (count($this->customModules) > 0) {
         $this->frontController->addModuleDirectory(Sydney_Tools_Paths::getCustomapPath() . '/modules');
         foreach ($this->customModules as $module => $role) {
             $this->frontController->addControllerDirectory(Sydney_Tools_Paths::getCustomapPath() . '/modules/' . $module . '/controllers', $module);
         }
     }
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:12,代码来源:Bootstrapper.php

示例5: _initApplication

 /**
  * init application
  * @return void
  */
 protected function _initApplication()
 {
     Zend_Session::setOptions(array('name' => $this->settings->page->session->name, 'save_path' => realpath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sessions')));
     Zend_Session::start();
     // sollte wenn name feststeht ge�ndert werden
     # get an instance of the frontend controller
     $this->bootstrap('FrontController');
     $this->frontController = Zend_Controller_Front::getInstance();
     # now add our own dispatcher
     $this->frontController->setDispatcher(new FansubCMS_Controller_Dispatcher_Standard());
     # prefix default module as well
     $this->frontController->setParam('prefixDefaultModule', true);
     # set default and module controller directrories
     //  $this->frontController->setControllerDirectory($this->settings->controllers->toArray());
     $this->frontController->addModuleDirectory(APPLICATION_PATH . "/modules");
     $this->frontController->removeControllerDirectory('default');
     # set default module
     $this->frontController->setDefaultModule("news");
     # Init application-wide Session
     $applicationSessionNamespace = new Zend_Session_Namespace('application');
     $applicationSessionNamespace->tstamp = !isset($applicationSessionNamespace->tstamp) ? time() : $applicationSessionNamespace->tstamp;
     # add it to the registry
     Zend_Registry::set('applicationSessionNamespace', $applicationSessionNamespace);
     # Init authentication Session
     $authSessionNamespace = new Zend_Session_Namespace('Zend_Auth');
     # add it to the registry
     Zend_Registry::set('AuthSessionNamespace', $authSessionNamespace);
     # set timezone
     date_default_timezone_set(empty($this->settings->page->timezone) ? 'Europe/Berlin' : $this->settings->page->timezone);
     # hook to settings
     $this->settings->applicationStatus = $this->applicationStatus;
     # hook needed objects/values to the zend registry
     Zend_Registry::set('settings', $this->settings);
     Zend_Registry::set('applicationStatus', $this->applicationStatus);
     Zend_Registry::set('environmentSettings', $this->environmentsettings);
     Zend_Registry::set('emailSettings', $this->mailsettings);
 }
开发者ID:KasaiDot,项目名称:FansubCMS,代码行数:41,代码来源:Bootstrap.php

示例6: initControllerFront

 /**
  * @static
  * @param \Zend_Controller_Front $front
  */
 public static function initControllerFront(\Zend_Controller_Front $front)
 {
     // disable build-in error handler
     $front->setParam('noErrorHandler', true);
     // for admin an other modules directly in the core
     $front->addModuleDirectory(PIMCORE_PATH . "/modules");
     // for plugins
     if (is_dir(PIMCORE_PLUGINS_PATH) && is_readable(PIMCORE_PLUGINS_PATH)) {
         $front->addModuleDirectory(PIMCORE_PLUGINS_PATH);
     }
     // for frontend (default: website)
     $front->addControllerDirectory(PIMCORE_WEBSITE_PATH . "/controllers", PIMCORE_FRONTEND_MODULE);
     $front->setDefaultModule(PIMCORE_FRONTEND_MODULE);
 }
开发者ID:pdaniel-frk,项目名称:pimcore,代码行数:18,代码来源:Pimcore.php

示例7: initControllers

 /**
  * Initialize Controller paths 
  * 
  * @return void
  */
 public function initControllers()
 {
     //$this->_front->addControllerDirectory($this->_root . '/application/modules/default/controllers', 'default');
     //$this->_front->addControllerDirectory($this->_root . '/application/modules/sc/controllers', 'sc');
     $this->_front->addModuleDirectory($this->_root . '/application/modules');
 }
开发者ID:neffers,项目名称:Nefcraft,代码行数:11,代码来源:Initializer.php

示例8: initFrontController

 public function initFrontController()
 {
     $this->_front->addModuleDirectory(APPLICATION_PATH . '/modules')->registerPlugin(new SxCms_Controller_Plugin_HTTPCrawler())->registerPlugin(new SxCms_Controller_Plugin_Auth())->registerPlugin(new SxCms_Controller_Plugin_Messenger())->registerPlugin(new SxCms_Controller_Plugin_PageLocker())->registerPlugin(new SxCms_Controller_Plugin_ErrorSelector());
 }
开发者ID:sonvq,项目名称:2015_freelance6,代码行数:4,代码来源:Bootstrap.php


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