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


PHP CRM_Utils_File::findFiles方法代码示例

本文整理汇总了PHP中CRM_Utils_File::findFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_File::findFiles方法的具体用法?PHP CRM_Utils_File::findFiles怎么用?PHP CRM_Utils_File::findFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Utils_File的用法示例。


在下文中一共展示了CRM_Utils_File::findFiles方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: findManyFiles

 /**
  * Find files in several directories using several filename patterns
  *
  * @param array $pairs each item is an array(0 => $searchBaseDir, 1 => $filePattern)
  * @return array of file paths
  */
 static function findManyFiles($pairs)
 {
     $files = array();
     foreach ($pairs as $pair) {
         list($dir, $pattern) = $pair;
         $files = array_merge($files, CRM_Utils_File::findFiles($dir, $pattern));
     }
     return $files;
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:15,代码来源:File.php

示例2: _api4_civix_find_files

/**
 * Search directory tree for files which match a glob pattern
 *
 * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored.
 * Note: In Civi 4.3+, delegate to CRM_Utils_File::findFiles()
 *
 * @param $dir string, base dir
 * @param $pattern string, glob pattern, eg "*.txt"
 * @return array(string)
 */
function _api4_civix_find_files($dir, $pattern)
{
    if (is_callable(array('CRM_Utils_File', 'findFiles'))) {
        return CRM_Utils_File::findFiles($dir, $pattern);
    }
    $todos = array($dir);
    $result = array();
    while (!empty($todos)) {
        $subdir = array_shift($todos);
        foreach (_api4_civix_glob("{$subdir}/{$pattern}") as $match) {
            if (!is_dir($match)) {
                $result[] = $match;
            }
        }
        if ($dh = opendir($subdir)) {
            while (FALSE !== ($entry = readdir($dh))) {
                $path = $subdir . DIRECTORY_SEPARATOR . $entry;
                if ($entry[0] == '.') {
                } elseif (is_dir($path)) {
                    $todos[] = $path;
                }
            }
            closedir($dh);
        }
    }
    return $result;
}
开发者ID:civicrm,项目名称:api4,代码行数:37,代码来源:api4.civix.php

示例3: getRelPaths

 /**
  * Scan $basedir for a list of extension-keys
  *
  * @return array
  *   ($key => $relPath)
  */
 protected function getRelPaths()
 {
     if (!is_array($this->relPaths)) {
         if ($this->cache) {
             $this->relPaths = $this->cache->get($this->cacheKey);
         }
         if (!is_array($this->relPaths)) {
             $this->relPaths = array();
             $infoPaths = CRM_Utils_File::findFiles($this->baseDir, 'info.xml');
             foreach ($infoPaths as $infoPath) {
                 $relPath = CRM_Utils_File::relativize(dirname($infoPath), $this->baseDir);
                 try {
                     $info = CRM_Extension_Info::loadFromFile($infoPath);
                 } catch (CRM_Extension_Exception_ParseException $e) {
                     CRM_Core_Session::setStatus(ts('Parse error in extension: %1', array(1 => $e->getMessage())), '', 'error');
                     CRM_Core_Error::debug_log_message("Parse error in extension: " . $e->getMessage());
                     continue;
                 }
                 $this->relPaths[$info->key] = $relPath;
             }
             if ($this->cache) {
                 $this->cache->set($this->cacheKey, $this->relPaths);
             }
         }
     }
     return $this->relPaths;
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:33,代码来源:Basic.php

示例4: loadSettingsMetadata

 /**
  * Load up settings metadata from files.
  */
 public static function loadSettingsMetadata($metaDataFolder)
 {
     $settingMetaData = array();
     $settingsFiles = CRM_Utils_File::findFiles($metaDataFolder, '*.setting.php');
     foreach ($settingsFiles as $file) {
         $settings = (include $file);
         $settingMetaData = array_merge($settingMetaData, $settings);
     }
     CRM_Core_BAO_Cache::setItem($settingMetaData, 'CiviCRM setting Spec', 'All');
     return $settingMetaData;
 }
开发者ID:kidaa30,项目名称:yes,代码行数:14,代码来源:Setting.php

示例5: getStrings

 /**
  * Get list of translatable strings for a module.
  *
  * @param string $name
  *   Angular module name.
  * @return array
  *   Translatable strings.
  */
 public function getStrings($name)
 {
     $module = $this->getModule($name);
     $result = array();
     if (isset($module['js'])) {
         foreach ($module['js'] as $file) {
             $strings = $this->res->getStrings()->get($module['ext'], $this->res->getPath($module['ext'], $file), 'text/javascript');
             $result = array_unique(array_merge($result, $strings));
         }
     }
     if (isset($module['partials'])) {
         foreach ($module['partials'] as $partialDir) {
             $partialDir = $this->res->getPath($module['ext']) . '/' . $partialDir;
             $files = \CRM_Utils_File::findFiles($partialDir, '*.html');
             foreach ($files as $file) {
                 $strings = $this->res->getStrings()->get($module['ext'], $file, 'text/html');
                 $result = array_unique(array_merge($result, $strings));
             }
         }
     }
     return $result;
 }
开发者ID:utkarshsharma,项目名称:civicrm-core,代码行数:30,代码来源:Manager.php

示例6: loadSettingsMetadata

 /**
  * Load up settings metadata from files.
  */
 protected static function loadSettingsMetadata($metaDataFolder)
 {
     $settingMetaData = array();
     $settingsFiles = \CRM_Utils_File::findFiles($metaDataFolder, '*.setting.php');
     foreach ($settingsFiles as $file) {
         $settings = (include $file);
         $settingMetaData = array_merge($settingMetaData, $settings);
     }
     return $settingMetaData;
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:13,代码来源:SettingsMetadata.php


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