本文整理汇总了PHP中sfApplicationConfiguration::getControllerDirs方法的典型用法代码示例。如果您正苦于以下问题:PHP sfApplicationConfiguration::getControllerDirs方法的具体用法?PHP sfApplicationConfiguration::getControllerDirs怎么用?PHP sfApplicationConfiguration::getControllerDirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfApplicationConfiguration
的用法示例。
在下文中一共展示了sfApplicationConfiguration::getControllerDirs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findModulePaths
/**
* Fetches and remembers in a property all possible module directories
*/
private function findModulePaths()
{
$dirsAsKeys = $this->appConf->getControllerDirs($this->moduleName);
$dirs = array();
foreach ($dirsAsKeys as $dir => $junk) {
$dirs[] = dirname($dir);
}
$this->modulePaths = $dirs;
}
示例2: getControllerDirs
/**
* Gets directories where controller classes are stored for a given module.
*
* @param string The module name
*
* @return array An array of directories
*/
public function getControllerDirs($moduleName)
{
// if there is a configuration dimension
if ($this->hasDimension()) {
$cacheKey = sprintf('sf_controller_dirs_%s', $moduleName);
// if there is a cache return it
if ($this->dimension->getCache()->has($cacheKey)) {
$dirs = $this->dimension->getCache()->get($cacheKey);
} else {
$dimensions = $this->dimension->getCascade();
// otherwise create and store
$dirs = array();
if (is_readable(sfConfig::get('sf_app_module_dir') . '/' . $moduleName . '/actions')) {
foreach ($dimensions as $dimension) {
if (is_readable(sfConfig::get('sf_app_module_dir') . '/' . $moduleName . '/actions/' . $dimension)) {
$dirs[sfConfig::get('sf_app_module_dir') . '/' . $moduleName . '/actions/' . $dimension] = false;
}
}
$dirs[sfConfig::get('sf_app_module_dir') . '/' . $moduleName . '/actions'] = false;
// application
}
foreach (sfConfig::get('sf_module_dirs', array()) as $key => $value) {
if (is_readable($key . '/' . $moduleName . '/actions')) {
// extend base dirs and add dimension cascade + checking dir exists
foreach ($dimensions as $dimension) {
if (is_readable($key . '/' . $moduleName . '/actions/' . $dimension)) {
$dirs[$key . '/' . $moduleName . '/actions/' . $dimension] = $value;
}
}
$dirs[$key . '/' . $moduleName . '/actions'] = $value;
}
}
if ($pluginDirs = glob(sfConfig::get('sf_plugins_dir') . '/*/modules/' . $moduleName . '/actions')) {
foreach ($pluginDirs as $dir) {
// extend base dirs and add dimension cascade + checking dir exists
foreach ($dimensions as $dimension) {
if (is_readable($dir . '/' . $dimension)) {
array_push($pluginDirs, $dir . '/' . $dimension);
}
}
}
$dirs = array_merge($dirs, array_combine($pluginDirs, array_fill(0, count($pluginDirs), true)));
// plugins
}
if (is_readable(sfConfig::get('sf_symfony_lib_dir') . '/controller/' . $moduleName . '/actions')) {
$dirs[sfConfig::get('sf_symfony_lib_dir') . '/controller/' . $moduleName . '/actions'] = true;
// core modules
}
// save cache
$this->dimension->getCache()->set($cacheKey, $dirs);
}
} else {
$dirs = parent::getControllerDirs($moduleName);
}
return $dirs;
}
示例3: getControllerDirs
/**
* Gets directories where controller classes are stored for a given module.
*
* @param string $moduleName The module name
*
* @return array An array of directories
*/
public function getControllerDirs($moduleName)
{
$dirs = array();
$dirs = array_merge($dirs, $this->globEnablePlugin('/apps/' . sfConfig::get('sf_app') . '/modules/' . $moduleName . '/actions', true));
$dirs = array_merge($dirs, parent::getControllerDirs($moduleName));
return $dirs;
}