realpathGlob tweaks, refs #2932
parent
443858dae7
commit
56c5af8dc4
|
@ -214,6 +214,6 @@ EOT
|
|||
protected function getOldInstallationFiles($rollbackDir)
|
||||
{
|
||||
$fs = new Filesystem;
|
||||
return $fs->realpathGlob($rollbackDir . '/*' . self::OLD_INSTALL_EXT) ?: array();
|
||||
return $fs->realpathGlob($rollbackDir . '/*' . self::OLD_INSTALL_EXT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ abstract class ArchiveDownloader extends FileDownloader
|
|||
*/
|
||||
private function listFiles($dir)
|
||||
{
|
||||
$files = array_merge($this->filesystem->realpathGlob($dir . '/.*') ?: array(), $this->filesystem->realpathGlob($dir . '/*') ?: array());
|
||||
$files = array_merge($this->filesystem->realpathGlob($dir . '/.*'), $this->filesystem->realpathGlob($dir . '/*'));
|
||||
|
||||
return array_values(array_filter($files, function ($el) {
|
||||
return basename($el) !== '.' && basename($el) !== '..';
|
||||
|
|
|
@ -126,7 +126,7 @@ class LibraryInstaller implements InstallerInterface
|
|||
$downloadPath = $this->getPackageBasePath($package);
|
||||
if (strpos($package->getName(), '/')) {
|
||||
$packageVendorDir = dirname($downloadPath);
|
||||
if (is_dir($packageVendorDir) && !$this->filesystem->realpathGlob($packageVendorDir.'/*')) {
|
||||
if (is_dir($packageVendorDir) && $this->filesystem->isDirEmpty($packageVendorDir)) {
|
||||
@rmdir($packageVendorDir);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,9 +52,9 @@ class Filesystem
|
|||
{
|
||||
$matches = glob($pattern, $flags);
|
||||
if (!$matches) {
|
||||
return false;
|
||||
return array();
|
||||
}
|
||||
var_dump($matches);
|
||||
|
||||
return array_map('realpath', $matches);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue