find artifacts recursively in given path
uses regex to filter file extensionpull/2004/head
parent
5701f60157
commit
ba87cfc6d1
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue