本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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');
}
示例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());
}