本文整理汇总了PHP中Zend_Controller_Front::addControllerDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Front::addControllerDirectory方法的具体用法?PHP Zend_Controller_Front::addControllerDirectory怎么用?PHP Zend_Controller_Front::addControllerDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Front
的用法示例。
在下文中一共展示了Zend_Controller_Front::addControllerDirectory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadExtensions
/**
* Load the extensions for the application
*
* WARNING: When using extensions, you MUST be careful not to name
* one using the same name as one of the controllers. If you do,
* ZF will think you're trying to use modules... heh heh heh
*
*/
protected function loadExtensions()
{
$this->extensions = array();
$extDir = ifset($this->config, 'extensions_dir', APP_DIR . '/extensions');
if (!is_dir($extDir)) {
return;
}
$dir = new DirectoryIterator($extDir);
foreach ($dir as $value) {
$dirname = $value->__toString();
if ($dirname == '.' || $dirname == '..') {
continue;
}
if (!is_dir($extDir . DIRECTORY_SEPARATOR . $dirname)) {
continue;
}
$base = $extDir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR;
if (is_dir($base . 'services')) {
$this->injector->addServiceDirectory($base . 'services');
}
if (is_dir($base . 'controllers')) {
// We add the 'ext' so that we don't clash with the module routing
$this->frontController->addControllerDirectory($base . 'controllers', 'ext-' . $dirname);
}
if (is_dir($base . 'views')) {
$view = Zend_Registry::get(self::$ZEND_VIEW);
/* @var $view CompositeView */
$view->addScriptPath($base . 'views');
}
// add the extension
$this->extensions[$dirname] = rtrim($base, '/');
}
}
示例2: 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);
}
}
}
示例3: _initControllers
protected function _initControllers()
{
$this->_front->addControllerDirectory(APPLICATION_PATH . '/admin/controllers', 'admin');
}
示例4: initControllers
/**
* Initialize Controller paths
*
* @return void
*/
public function initControllers()
{
$this->_front->addControllerDirectory($this->_root . '/application/default/controllers', 'default');
$this->_front->addControllerDirectory($this->_root . '/application/dashboard/controllers', 'dashboard');
$this->_front->addControllerDirectory($this->_root . '/application/data/controllers', 'data');
}
示例5: loadNamespacesAndModules
/**
* Loads and initializes zendfox module system
*
* @param Zend_Controller_Front $front
* @return array
*/
private static function loadNamespacesAndModules(Zend_Controller_Front $front, $bootS)
{
if (null == self::$modules) {
self::$modules = array();
$loader = Zend_Loader_Autoloader::getInstance();
if ((self::$modules = self::$cache->load('fox_modules')) === false) {
$dbConf = $bootS->db->getConfig();
if (self::$modeRun) {
$mData = self::$dbAdapter->fetchAll("SELECT * FROM {$dbConf['prefix']}core_module");
foreach ($mData as $mInfo) {
$name = trim($mInfo['name']);
$enabled = trim($mInfo['status']);
$package = trim($mInfo['package']);
$nameSpc = trim($mInfo['namespace']);
if ($name != '' && $enabled == 1 && $package != '' && $nameSpc != '') {
$moduleDir = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . $nameSpc . DIRECTORY_SEPARATOR . $name;
self::$modules[$name]['path'] = $moduleDir;
self::$modules[$name]['namespace'] = $nameSpc;
}
}
//Caching module info
self::$cache->save(self::$modules, 'fox_modules');
} else {
// ********Reading Module info from XML files**********************/
$doc = new DOMDocument();
if (is_dir(MODULE_CONFIG_DIR)) {
$dp = opendir(MODULE_CONFIG_DIR);
while ($file = readdir($dp)) {
if (!($file == '.' || $file == '..')) {
$fPath = MODULE_CONFIG_DIR . DIRECTORY_SEPARATOR . $file;
if (is_readable($fPath) && is_file($fPath)) {
$doc->load($fPath);
if ($doc->documentElement->childNodes) {
$nList = $doc->documentElement->childNodes;
foreach ($nList as $n) {
if ($n->nodeName == 'module' && ($name = $n->getAttribute('name')) && ($enabled = $n->getAttribute('enabled') === 'true') && ($package = $n->getAttribute('package')) && ($nameSpc = $n->getAttribute('namespace'))) {
if ($enabled) {
$moduleDir = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . $nameSpc . DIRECTORY_SEPARATOR . $name;
self::$modules[$name]['path'] = $moduleDir;
self::$modules[$name]['namespace'] = $nameSpc;
}
}
}
}
}
}
}
}
/* * ****End Reading module info from XML files************** */
}
}
$ns = array();
foreach (self::$modules as $name => $module) {
$moduleDir = $module['path'];
$nameSpc = $module['namespace'];
if (!in_array($nameSpc, $ns)) {
$loader->registerNamespace($nameSpc . '_');
$ns[] = $nameSpc;
}
$front->addControllerDirectory($moduleDir . DIRECTORY_SEPARATOR . 'controllers', $name);
//Translation loading
if (NULL == self::$translator) {
self::$translator = new Zend_Translate(array('adapter' => 'csv', 'locale' => 'auto'));
Zend_Registry::set('translator', self::$translator);
// self::$translator->setLocale(Zend_Registry::get('Zend_Locale'));
}
$langDir = $moduleDir . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR;
if (file_exists($langDir)) {
self::$translator->addTranslation(array('content' => $langDir, 'scan' => Zend_Translate::LOCALE_FILENAME));
}
}
unset($ns);
}
}
示例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/default/controllers', 'default');
$this->_front->addControllerDirectory($this->_root . '/application/user/controllers', 'user');
}