本文整理汇总了PHP中ProjectConfiguration::getPluginSubPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectConfiguration::getPluginSubPaths方法的具体用法?PHP ProjectConfiguration::getPluginSubPaths怎么用?PHP ProjectConfiguration::getPluginSubPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectConfiguration
的用法示例。
在下文中一共展示了ProjectConfiguration::getPluginSubPaths方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSchemas
/**
* Getting schemas array from configs
*
* @return array - Connections and tables
* @author Sergey Startsev
*/
private static function getSchemas()
{
$aPropelSchemaArray = array();
$configuration = new ProjectConfiguration(null, new sfEventDispatcher());
$db_schema = new sfPropelDatabaseSchema();
$dirs = array_merge(array(sfConfig::get('sf_config_dir')), $configuration->getPluginSubPaths('/config'));
foreach ($dirs as $k => $dir) {
if (substr_count($dir, 'appFlower') > 0 || substr_count($dir, 'sfPropelPlugin') > 0 || substr_count($dir, 'sfProtoculousPlugin') > 0) {
unset($dirs[$k]);
}
}
$dirs = array_values($dirs);
$schemas = sfFinder::type('file')->name('*schema.yml')->prune('doctrine')->in($dirs);
foreach ($schemas as $schema_path) {
$schema = DIRECTORY_SEPARATOR != '/' ? str_replace('/', DIRECTORY_SEPARATOR, $schema_path) : $schema_path;
$aOriginalSchemaArray[$schema] = sfYaml::load($schema);
if (!is_array($aOriginalSchemaArray[$schema])) {
$aOriginalSchemaArray[$schema];
continue;
// No defined schema here, skipping
}
if (!isset($aOriginalSchemaArray[$schema]['classes'])) {
// Old schema syntax: we convert it
$aPropelSchemaArray[$schema] = $db_schema->convertOldToNewYaml($aOriginalSchemaArray[$schema]);
}
$customSchemaFilename = str_replace(array(str_replace(DIRECTORY_SEPARATOR, '/', sfConfig::get('sf_root_dir')) . '/', 'plugins/', 'config/', '/', 'schema.yml'), array('', '', '', '_', 'schema.custom.yml'), $schema);
$customSchemas = sfFinder::type('file')->name($customSchemaFilename)->in($dirs);
foreach ($customSchemas as $customSchema) {
$aOriginalSchemaArray[$customSchema] = sfYaml::load($customSchema);
if (!isset($aOriginalSchemaArray[$customSchema]['classes'])) {
// Old schema syntax: we convert it
$aPropelSchemaArray[$customSchema] = $db_schema->convertOldToNewYaml(${$aOriginalSchemaArray}[$customSchema]);
}
}
}
return $aPropelSchemaArray;
}