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


PHP RecursiveDirectoryIterator::getPathname方法代码示例

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


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

示例1: getAllSubDirectory

 /**
  * Get all sub directory
  * @param string $path The base path want to find
  * @return array Array of path of sub directory founded
  */
 public static function getAllSubDirectory($path)
 {
     $rdi = new RDIterator($path, RDIterator::SKIP_DOTS);
     $subDirs = [];
     foreach ($rdi as $item) {
         if ($item->isDir()) {
             $subDirs[] = $rdi->getPathname();
         }
     }
     return $subDirs;
 }
开发者ID:johnitvn,项目名称:yii2-workbench,代码行数:16,代码来源:FileSystem.php

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


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