فهرست منبع

realpathGlob tweaks, refs #2932

Jordi Boggiano 10 سال پیش
والد
کامیت
56c5af8dc4

+ 1 - 1
src/Composer/Command/SelfUpdateCommand.php

@@ -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);
     }
 }

+ 1 - 1
src/Composer/Downloader/ArchiveDownloader.php

@@ -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) !== '..';

+ 1 - 1
src/Composer/Installer/LibraryInstaller.php

@@ -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);
             }
         }

+ 2 - 2
src/Composer/Util/Filesystem.php

@@ -52,9 +52,9 @@ class Filesystem
     {
         $matches = glob($pattern, $flags);
         if (!$matches) {
-            return false;
+            return array();
         }
-        var_dump($matches);
+
         return array_map('realpath', $matches);
     }