Merge pull request #1981 from orukusaki/closure-fix
Unbind the filter Closure from ArchivableFilesFinder to allow the object to be garbage collectedpull/1979/merge
commit
4fe074efdc
|
@ -52,9 +52,8 @@ class ArchivableFilesFinder extends \FilterIterator
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->finder = new Finder\Finder();
|
$this->finder = new Finder\Finder();
|
||||||
$this->finder
|
|
||||||
->in($sources)
|
$filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) {
|
||||||
->filter(function (\SplFileInfo $file) use ($sources, $filters, $fs) {
|
|
||||||
$relativePath = preg_replace(
|
$relativePath = preg_replace(
|
||||||
'#^'.preg_quote($sources, '#').'#',
|
'#^'.preg_quote($sources, '#').'#',
|
||||||
'',
|
'',
|
||||||
|
@ -66,7 +65,15 @@ class ArchivableFilesFinder extends \FilterIterator
|
||||||
$exclude = $filter->filter($relativePath, $exclude);
|
$exclude = $filter->filter($relativePath, $exclude);
|
||||||
}
|
}
|
||||||
return !$exclude;
|
return !$exclude;
|
||||||
})
|
};
|
||||||
|
|
||||||
|
if (method_exists($filter, 'bindTo')) {
|
||||||
|
$filter = $filter->bindTo(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->finder
|
||||||
|
->in($sources)
|
||||||
|
->filter($filter)
|
||||||
->ignoreVCS(true)
|
->ignoreVCS(true)
|
||||||
->ignoreDotFiles(false);
|
->ignoreDotFiles(false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue