本文整理汇总了PHP中sfProjectConfiguration::getGeneratorSkeletonDirs方法的典型用法代码示例。如果您正苦于以下问题:PHP sfProjectConfiguration::getGeneratorSkeletonDirs方法的具体用法?PHP sfProjectConfiguration::getGeneratorSkeletonDirs怎么用?PHP sfProjectConfiguration::getGeneratorSkeletonDirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfProjectConfiguration
的用法示例。
在下文中一共展示了sfProjectConfiguration::getGeneratorSkeletonDirs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGeneratorSkeletonDirs
/**
* Gets directories where the skeleton is stored for a generator class and a specific theme.
*
* @param string The generator class name
* @param string The theme name
*
* @return array An array of directories
*/
public function getGeneratorSkeletonDirs($class, $theme)
{
// if there is a configuration dimension
if ($this->hasDimension()) {
$cacheKey = sprintf('sf_generator_skeleton_dirs_%s_%s', $class, $theme);
// 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();
// project
if (is_readable(sfConfig::get('sf_data_dir') . '/generator/' . $class . '/' . $theme . '/skeleton')) {
$dir = sfConfig::get('sf_data_dir') . '/generator/' . $class . '/' . $theme . '/skeleton';
// extend base dirs and add dimension cascade + checking dir exists
foreach ($dimensions as $dimension) {
if (is_readable($dir . '/' . $dimension)) {
array_push($dirs, $dir . '/' . $dimension);
}
}
array_push($dirs, $dir);
// project
}
if ($pluginDirs = glob(sfConfig::get('sf_plugins_dir') . '/*/data/generator/' . $class . '/' . $theme . '/skeleton')) {
foreach ($pluginDirs as $dir) {
foreach ($dimensions as $dimension) {
if (is_readable($dir . '/' . $dimension)) {
array_push($dirs, $dir . '/' . $dimension);
}
}
array_push($dirs, $dir);
// plugin
}
}
if ($bundledPluginDirs = glob(sfConfig::get('sf_symfony_lib_dir') . '/plugins/*/data/generator/' . $class . '/' . $theme . '/skeleton')) {
$dirs = array_merge($dirs, $bundledPluginDirs);
// bundled plugin
}
// save cache
$this->dimension->getCache()->set($cacheKey, $dirs);
}
} else {
$dirs = parent::getGeneratorSkeletonDirs($class, $theme);
}
return $dirs;
}