Commit 2252ba8e authored by webchick's avatar webchick

Issue #2216695 by sun, Damien Tournoud, Wim Leers, brantwynn: Run-tests.sh...

Issue #2216695 by sun, Damien Tournoud, Wim Leers, brantwynn: Run-tests.sh broken on OS X ('Too many open files').
parent 32befa4b
......@@ -186,22 +186,6 @@ public function __call($method, array $args) {
return call_user_func_array(array($this->splFileInfo, $method), $args);
}
/**
* Sets an explicit SplFileInfo object for the extension's info file.
*
* Used by ExtensionDiscovery::scanDirectory() to avoid creating additional
* PHP resources.
*
* @param \SplFileInfo $fileinfo
* A file info instance to set.
*
* @return $this
*/
public function setSplFileInfo(\SplFileInfo $fileinfo) {
$this->splFileInfo = $fileinfo;
return $this;
}
/**
* Implements Serializable::serialize().
*
......
......@@ -165,7 +165,7 @@ public function scan($type, $include_tests = NULL) {
foreach ($files as $key => $file) {
// If the extension does not belong to a profile, just apply the weight
// of the originating directory.
if (strpos($file->getSubPath(), 'profiles') !== 0) {
if (strpos($file->subpath, 'profiles') !== 0) {
$origins[$key] = $origin_weights[$file->origin];
$profiles[$key] = NULL;
}
......@@ -380,10 +380,9 @@ protected function scanDirectory($dir, $include_tests) {
}
$extension = new Extension($type, $pathname, $filename);
// Inject the existing RecursiveDirectoryIterator object to avoid
// unnecessary creation of additional SplFileInfo resources.
$extension->setSplFileInfo($fileinfo);
// Track the originating directory for sorting purposes.
$extension->subpath = $fileinfo->getSubPath();
$extension->origin = $dir;
$files[$type][$key] = $extension;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment