当前位置: 首页>>代码示例>>PHP>>正文


PHP ProjectConfiguration::getPluginSubPaths方法代码示例

本文整理汇总了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;
 }
开发者ID:cbsistem,项目名称:appflower_studio,代码行数:43,代码来源:afsDatabaseQuery.class.php


注:本文中的ProjectConfiguration::getPluginSubPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。