當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。