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


PHP RecursiveDirectoryIterator::isDot方法代码示例

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


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

示例1: show_maps

function show_maps()
{
    $maps = array();
    $it = new RecursiveDirectoryIterator('../maps');
    foreach (new RecursiveIteratorIterator($it) as $file) {
        if (!$it->isDot()) {
            array_push($maps, basename($file));
        }
    }
    echo json_encode($maps);
}
开发者ID:kaizensoze,项目名称:chips-challenge,代码行数:11,代码来源:chip.php

示例2: 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

示例3: getImagePaths

 /**
  * A function to (optionally) recursive through a root directory,
  * retrieving image paths
  *
  * @param $folder
  * 	The root folder to start the scanning
  * @param $enable_chidren
  * 	Boolean value to enable scanning through child folders, default to false
  *
  * @return
  * 	An array of image paths
  *
  * @todo
  * 	Use more robust php recursive directory search options
  */
 static function getImagePaths($folder, $enable_chidren = FALSE)
 {
     $image_array = array();
     $iterator = new RecursiveDirectoryIterator($folder);
     $image_array = array_merge($image_array, VSMGFileHelper::getDirectoryImages($folder));
     if ($enable_chidren) {
         foreach ($iterator as $file) {
             if (is_dir($file) && !$iterator->isDot()) {
                 // echo "VSMGFileHelper::getImagePaths DIR: $file\n";
                 $image_array = array_merge($image_array, VSMGFileHelper::getDirectoryImages($file));
             }
         }
     }
     return $image_array;
 }
开发者ID:niallcreech,项目名称:vsmg,代码行数:30,代码来源:VSMGFileHelper.php

示例4: scanFilesObj

 /**
  * fills the list of availible files, with DirectoryIterator object as value
  *
  * @return void
  */
 protected function scanFilesObj()
 {
     if (!empty($this->filesObj)) {
         return;
     }
     if ($this->recursive) {
         $it = new RecursiveIteratorIterator($this->obj, RecursiveIteratorIterator::CHILD_FIRST);
         foreach ($it as $filename => $obj) {
             if ($it->isDot()) {
                 continue;
             }
             $this->filesObj[$filename] = $obj;
         }
     } else {
         foreach ($this->obj as $filename => $obj) {
             if ($this->obj->isDot()) {
                 continue;
             }
             $this->filesObj[$obj->getFilename()] = $obj;
         }
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:27,代码来源:DirectoryUtil.class.php

示例5: parseDir

 /**
  * parse this directory
  *
  * @return  none
  */
 protected function parseDir()
 {
     $this->clear();
     $iter = new RecursiveDirectoryIterator($this->getPath());
     while ($iter->valid()) {
         $curr = (string) $iter->getSubPathname();
         if (!$iter->isDot() && $curr[0] != '.') {
             $this->addItem(Varien_Directory_Factory::getFactory($iter->current(), $this->getRecursion(), $this->getRecursionLevel()));
         }
         $iter->next();
     }
 }
开发者ID:natxetee,项目名称:magento2,代码行数:17,代码来源:Collection.php

示例6: emptyDirectoryRecursively

 /**
  * Deletes all files, directories and subdirectories from the specified
  * directory. The passed directory itself won't be deleted though.
  *
  * @param string $path Path to the directory which shall be emptied.
  * @return void
  * @throws Exception
  * @see removeDirectoryRecursively()
  */
 public static function emptyDirectoryRecursively($path)
 {
     if (!is_dir($path)) {
         throw new \TYPO3\Flow\Utility\Exception('"' . $path . '" is no directory.', 1169047616);
     }
     if (self::is_link($path)) {
         if (self::unlink($path) !== TRUE) {
             throw new \TYPO3\Flow\Utility\Exception('Could not unlink symbolic link "' . $path . '".', 1323697654);
         }
     } else {
         $directoryIterator = new \RecursiveDirectoryIterator($path);
         foreach ($directoryIterator as $fileInfo) {
             if (!$fileInfo->isDir()) {
                 if (self::unlink($fileInfo->getPathname()) !== TRUE) {
                     throw new \TYPO3\Flow\Utility\Exception('Could not unlink file "' . $fileInfo->getPathname() . '".', 1169047619);
                 }
             } elseif (!$directoryIterator->isDot()) {
                 self::removeDirectoryRecursively($fileInfo->getPathname());
             }
         }
     }
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:31,代码来源:Files.php

示例7: remove

 function remove($dirname) {
     if (is_dir($dirname)) {
         $dir=new RecursiveDirectoryIterator($dirname);
         foreach ($dir as $k=>$v) {
             if (!$dir->isDot()) {
                 if ($v->isDir()) {
                     self::remove($v->getPathname());
                 }
                 else {
                     unlink($v->getPathname());
                 }
             }
         }
         unset($dir);
         rmdir($dirname);
         return true;
     }
     return false;
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:19,代码来源:front_class.php

示例8: iterateFiles

 /**
  * Not using recursiveDirectoryIterator to savely ignore unreadable directories
  * 
  * @param RecursiveDirectoryIterator $iter
  */
 protected function iterateFiles(RecursiveDirectoryIterator $iter)
 {
     foreach ($iter as $file) {
         if (!is_readable($file)) {
             continue;
         } else {
             if (!$iter->isDot()) {
                 if (is_file((string) $file)) {
                     if (!$this->isIgnored($file) && !$this->isIgnoredDirectory($file)) {
                         $this->results[] = new Robo47_DirectoryHasher_Result_File($file);
                     }
                 } else {
                     if (is_dir($file)) {
                         $this->iterateFiles(new RecursiveDirectoryIterator((string) $file));
                     }
                 }
             }
         }
     }
 }
开发者ID:robo47,项目名称:Robo47_DirectoryHasher,代码行数:25,代码来源:Directory.php

示例9: unzipAll

 /**
  * Recursively go through each folder and extract the archives
  *
  * @param $start
  */
 public function unzipAll($start)
 {
     $iterator = new RecursiveDirectoryIterator($start);
     foreach ($iterator as $file) {
         if ($file->isFile()) {
             $extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
             if ($extension == 'zip') {
                 $unzip = $file->getPath() . '/' . $file->getBasename('.' . $extension);
                 $result = JArchive::extract($file->getPathname(), $unzip);
                 //                     delete the archive once we extract it
                 if ($result) {
                     JFile::delete($file->getPathname());
                     //                      now check the new extracted folder for archive files
                     $this->unzipAll($unzip);
                 }
             }
         } else {
             if (!$iterator->isDot()) {
                 $this->unzipAll($file->getPathname());
             }
         }
     }
 }
开发者ID:angelexevior,项目名称:jedchecker,代码行数:28,代码来源:uploads.php

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

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

示例12: valid

 function valid()
 {
     if (parent::valid()) {
         if (!parent::isDir() || parent::isDot()) {
             parent::next();
             return $this->valid();
         }
         return TRUE;
     }
     return FALSE;
 }
开发者ID:HenrikTolboel,项目名称:LinnDS-jukebox,代码行数:11,代码来源:MakePlaylists.php


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