本文整理匯總了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;
}