Created
May 21, 2013 22:51
-
-
Save thiagorock22/5623909 to your computer and use it in GitHub Desktop.
Implementação de um iterator para listar pastas que são workspace do SVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SVN_WorkspaceIterator extends FilterIterator { | |
| protected $ext = ".svn"; | |
| public function __construct (DirectoryIterator $iterator) { | |
| parent::__construct($iterator); | |
| } | |
| public function accept() { | |
| return ( ($this->isDir()) && (!$this->isDot()) && file_exists($this->getPathname().'/'.$this->ext)); | |
| } | |
| } | |
| $dir = new SVN_WorkspaceIterator(new DirectoryIterator("/var/www")); | |
| foreach ($dir as $v) { | |
| echo $v->getFilename(); echo "\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment