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


PHP RecursiveDirectoryIterator::isFile方法代码示例

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


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

示例1: load_tests

 private function load_tests(RecursiveDirectoryIterator $dir)
 {
     while ($dir->valid()) {
         $current = $dir->current();
         if ($dir->isFile() && preg_match("/(.)Test\\.php\$/", $current->getFilename(), $matches)) {
             // XXX: handle errors
             include $current->getPathname();
             $x = explode('.', $current->getFilename());
             $class = $x[0];
             $rclass = new ReflectionClass($class);
             if ($rclass->getParentClass()->getName() == 'UnitTest') {
                 $this->cases[] = $rclass;
             }
         } elseif ($dir->hasChildren() && preg_match("/^\\./", $current->getFilename(), $matches) == 0) {
             $this->load_tests($dir->getChildren());
         }
         $dir->next();
     }
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:19,代码来源:TestRunner.php

示例2: _recurseDirectory

 /**
  * Recursive directory function.
  *
  * @param RecursiveDirectoryIterator $iterator 
  */
 protected function _recurseDirectory($iterator)
 {
     while ($iterator->valid()) {
         if ($iterator->isDir() && !$iterator->isDot()) {
             if ($iterator->hasChildren()) {
                 $this->_recurseDirectory($iterator->getChildren());
             }
         } elseif ($iterator->isFile()) {
             $path = $iterator->getPath() . '/' . $iterator->getFilename();
             $pathinfo = pathinfo($path);
             if ($this->_isPhpFile($path)) {
                 $this->addFile($path);
             }
         }
         $iterator->next();
     }
 }
开发者ID:bbc-frameworks,项目名称:vonnegut,代码行数:22,代码来源:Cli.php

示例3: array

}
mysql_connection_select(DATABASE);
// set parameter defaults
$formImportDir = @$_REQUEST['formImportDir'];
// outName returns the hml direct.
$resourceUriRoot = @$_REQUEST['resourceUriRoot'];
// URI prefix for the resources upload with forms.
//if no style given then try default, if default doesn't exist we our put raw xml
$importData = array();
$info = new SplFileInfo($formImportDir);
$i = 0;
$xmlForms = array("form" => array(), "resource" => array());
if ($info->isDir()) {
    $iterator = new RecursiveDirectoryIterator($formImportDir);
    while ($iterator->valid()) {
        if ($iterator->isFile()) {
            $ext = pathinfo($iterator->getPathname(), PATHINFO_EXTENSION);
            if ($ext == "xml") {
                //				echo $prefix,$j,"&nbsp;import ",$dirIterator->getPathname(), "<br>\n";
                $xmlForms["form"][$iterator->getFilename()] = $iterator->getPathname();
            } else {
                $filepath = preg_replace("/" . preg_replace("/\\//", "\\\\/", HEURIST_UPLOAD_DIR) . "/", "/", $iterator->getPathname());
                //				echo $prefix,$j,"&nbsp;resource ".$dirIterator->getFilename()." has path ".$filepath, "<br>\n";
                $xmlForms["resource"][$iterator->getFilename()] = $filepath;
            }
        } else {
            if ($iterator->isDir() && $iterator->hasChildren(false)) {
                //			echo $i,pathinfo($iterator->getPathname(),PATHINFO_FILENAME), "<br>\n";
                processChildDir($iterator->getChildren(), $i . "-");
            }
        }
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:31,代码来源:prepFormsImport.php

示例4: _fetch

 /**
  * 
  * Recursively iterates through a directory looking for class files.
  * 
  * Skips CVS directories, and all files and dirs not starting with
  * a capital letter (such as dot-files).
  * 
  * @param RecursiveDirectoryIterator $iter Directory iterator.
  * 
  * @return void
  * 
  */
 protected function _fetch(RecursiveDirectoryIterator $iter)
 {
     for ($iter->rewind(); $iter->valid(); $iter->next()) {
         // preliminaries
         $path = $iter->current()->getPathname();
         $file = basename($path);
         $capital = ctype_alpha($file[0]) && $file == ucfirst($file);
         $phpfile = strripos($file, '.php');
         // check for valid class files
         if ($iter->isDot() || !$capital) {
             // skip dot-files (including dot-file directories), as
             // well as files/dirs not starting with a capital letter
             continue;
         } elseif ($iter->isDir() && $file == 'CVS') {
             // skip CVS directories
             continue;
         } elseif ($iter->isDir() && $iter->hasChildren()) {
             // descend into child directories
             $this->_fetch($iter->getChildren());
         } elseif ($iter->isFile() && $phpfile) {
             // map the .php file to a class name
             $len = strlen($this->_base);
             $class = substr($path, $len, -4);
             // drops .php
             $class = str_replace(DIRECTORY_SEPARATOR, '_', $class);
             $this->_map[$class] = $path;
         }
     }
 }
开发者ID:agentile,项目名称:foresmo,代码行数:41,代码来源:Map.php


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