1
0
Fork 0

find artifacts recursively in given path

uses regex to filter file extension
pull/2004/head
Jan Prieser 2013-06-13 15:52:52 +02:00
parent 5701f60157
commit ba87cfc6d1
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ class ArtifactRepository extends ArrayRepository
private function scanDirectory($path) private function scanDirectory($path)
{ {
$io = $this->io; $io = $this->io;
foreach (new \RecursiveDirectoryIterator($path) as $file) {
$directory = new \RecursiveDirectoryIterator($path);
$iterator = new \RecursiveIteratorIterator($directory);
$regex = new \RegexIterator($iterator, '/^.+\.(zip|phar)$/i');
foreach ($regex as $file) {
/* @var $file \SplFileInfo */ /* @var $file \SplFileInfo */
if (!$file->isFile()) { if (!$file->isFile()) {
continue; continue;