fix unix root dir issue
This commit is contained in:
parent
f20b36e3de
commit
9e431038b2
@ -744,6 +744,10 @@ class Finder implements \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
private function normalizeDir($dir)
|
private function normalizeDir($dir)
|
||||||
{
|
{
|
||||||
|
if ('/' === $dir) {
|
||||||
|
return $dir;
|
||||||
|
}
|
||||||
|
|
||||||
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
|
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {
|
if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {
|
||||||
|
@ -74,7 +74,11 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
|||||||
}
|
}
|
||||||
$subPathname .= $this->getFilename();
|
$subPathname .= $this->getFilename();
|
||||||
|
|
||||||
return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
|
if ('/' !== $basePath = $this->rootPath) {
|
||||||
|
$basePath .= $this->directorySeparator;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user