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


PHP RecursiveDirectoryIterator::rewind方法代码示例

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


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

示例1: rewind

 public function rewind()
 {
     if (false === $this->isRewindable()) {
         return;
     }
     parent::next();
     parent::rewind();
 }
开发者ID:florinmatthew,项目名称:find-file-content,代码行数:8,代码来源:RecursiveDirectoryIterator.php

示例2: rewind

 /**
  * Do nothing for non rewindable stream
  */
 public function rewind()
 {
     if (false === $this->isRewindable()) {
         return;
     }
     // @see https://bugs.php.net/bug.php?id=49104
     parent::next();
     parent::rewind();
 }
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:12,代码来源:RecursiveDirectoryIterator.php

示例3: rewind

 public function rewind()
 {
     if (false === $this->isRewindable()) {
         return;
     }
     if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
         parent::next();
     }
     parent::rewind();
 }
开发者ID:Ryu0621,项目名称:SaNaVi,代码行数:10,代码来源:RecursiveDirectoryIterator.php

示例4: gettype

<?php

$it1 = new RecursiveDirectoryIterator(dirname(__FILE__), FileSystemIterator::CURRENT_AS_PATHNAME);
$it1->rewind();
echo gettype($it1->current()) . "\n";
$it2 = new RecursiveDirectoryIterator(dirname(__FILE__));
$it2->rewind();
echo gettype($it2->current()) . "\n";
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:bug47534.php

示例5: addFolder

 /**
  * @inheritdoc
  */
 public function addFolder($path, $parent = '')
 {
     /**
      * @var \SplFileInfo $item
      */
     if (file_exists($path)) {
         $parent = $parent === null ? '' : $parent . DIRECTORY_SEPARATOR;
         $innerPath = $parent . basename($path);
         $dir = new \RecursiveDirectoryIterator($path);
         $dir->rewind();
         while ($dir->valid()) {
             $item = $dir->current();
             if ($item->isDir()) {
                 if (!in_array($item->getFilename(), array('.', '..'))) {
                     $this->addFolder($item->getRealPath(), $innerPath);
                 }
             } else {
                 $this->addFile($item->getRealPath(), $innerPath . DIRECTORY_SEPARATOR . $item->getFilename(), true);
             }
             $dir->next();
         }
     }
     return $this->updateArchive();
 }
开发者ID:elibyy,项目名称:zip,代码行数:27,代码来源:ZipAdapter.php

示例6: rewind

 /**
  * Do nothing for non rewindable stream.
  */
 public function rewind()
 {
     if (false === $this->isRewindable()) {
         return;
     }
     // @see https://bugs.php.net/68557
     if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
         parent::next();
     }
     parent::rewind();
 }
开发者ID:heximcz,项目名称:routerboard-backup,代码行数:14,代码来源:RecursiveDirectoryIterator.php

示例7: rewind

 public function rewind()
 {
     parent::rewind();
     // Skip current and parent directory
     $this->skipdots();
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:6,代码来源:class-ai1wm-recursive-directory-iterator.php

示例8: rewind

 function rewind()
 {
     echo __FUNCTION__ . "\n";
     return parent::rewind();
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:5,代码来源:call_order.php

示例9: _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

示例10: resolve

 /**
  * @private
  *
  * 1. Mimics tmp directory
  * 2. Find latest cache if $hash is null
  * 3. Return directory if $hash is '*'
  */
 private static function resolve($key, $hash = null)
 {
     $target = sys_get_temp_dir();
     if (strrpos($target, DIRECTORY_SEPARATOR) !== strlen($target) - 1) {
         $target .= DIRECTORY_SEPARATOR;
     }
     $target .= md5($key);
     if (!file_exists($target)) {
         if ($hash !== '*') {
             return null;
         } elseif (mkdir($target) === false) {
             throw new FrameworkException('Error creating cache folder "' . $target . '", please check folder permissions.');
         }
     } else {
         if (is_file($target)) {
             throw new FrameworkException($target . ' is already a file, please specify another path.');
         }
     }
     $target .= DIRECTORY_SEPARATOR;
     if ($hash === '*') {
         return new \RecursiveDirectoryIterator($target, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS);
     }
     if ($hash !== null) {
         $target = "{$target}{$hash}";
         if (!is_file($target)) {
             throw new FrameworkException('Target revision is not a file.');
         }
         return new \SplFileInfo($target);
     } else {
         $res = new \RecursiveDirectoryIterator($target, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS);
         $res->next();
         $res->rewind();
         $lfile = null;
         foreach ($res as $file) {
             if ($file->isFile() && strlen($file->getFilename()) == 32 && ($lfile == null || $lfile->getMTime() < $file->getMTime())) {
                 $lfile = $file;
             }
         }
         if ($lfile === null) {
             return null;
         }
         if (!$lfile->isReadable() || !$lfile->isWritable()) {
             throw new FrameworkException('Cache cannot be read or written, please check file permission to PHP user.');
         }
         return $lfile;
     }
 }
开发者ID:Victopia,项目名称:prefw,代码行数:54,代码来源:Cache.php

示例11: array

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<!--стили сайта-->
<?php 
Yii::app()->bootstrap->init();
$assets = Yii::app()->getModule('docs')->assetsUrl();
Yii::app()->clientScript->registerCssFile($assets . '/css/styles.css');
?>

</head>
<body>
<?php 
$items = array();
$i = new RecursiveDirectoryIterator(Yii::getPathOfAlias('docs.views.documentation'));
for ($i->rewind(); $i->valid(); $i->next()) {
    $item = $i->current();
    if (!$i->hasChildren()) {
        continue;
    }
    $folder_name = t($item->getFileName());
    $active_folder = false;
    $tmp = array();
    foreach ($i->getChildren() as $child) {
        list($file) = explode('.', $child->getFileName());
        $active = isset($_GET['alias']) && $_GET['alias'] == $file ? true : false;
        $active_folder = $active_folder || $active;
        $tmp[] = array('label' => t($file), 'itemOptions' => array(), 'active' => $active, 'url' => Yii::app()->createUrl('/docs/documentation/index', array('alias' => $file, 'folder' => $item->getFileName())));
    }
    if ($active_folder) {
        $items[] = array('label' => $folder_name, 'itemOptions' => array('class' => 'nav-header'));
开发者ID:nizsheanez,项目名称:documentation,代码行数:31,代码来源:mark.php


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