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


PHP RecursiveDirectoryIterator::getFilename方法代码示例

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


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

示例1: valid

 /**
  * Returns true if file is valid.
  * Valid Files: Directories and Files not beginning with a "." (dot).
  *
  * @todo make it more flexible to handle hidden dirs on demand etc,
  * win/*nix compat
  * 
  * @return boolean if current file entry is vali
  */
 public function valid()
 {
     if (parent::valid()) {
         if (parent::isDot() || parent::isDir() && strpos(parent::getFilename(), '.') === 0) {
             parent::next();
             // zum nächsten eintrag hüpfen
             return $this->valid();
             // nochmal prüfen
         }
         return true;
     }
     return false;
 }
开发者ID:joshiausdemwald,项目名称:sfFilebasePlugin,代码行数:22,代码来源:sfFilebasePluginRecursiveDirectoryIterator.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

// 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 . "-");
            }
        }
        $iterator->next();
        $i++;
    }
} else {
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:31,代码来源:prepFormsImport.php


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