Explorar el Código

GLOB_BRACE is not defined on all platforms

Markus Staab hace 6 años
padre
commit
e89d16c47d
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      src/Composer/Repository/PathRepository.php

+ 7 - 1
src/Composer/Repository/PathRepository.php

@@ -174,9 +174,15 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
      */
     private function getUrlMatches()
     {
+        $flags = GLOB_MARK | GLOB_ONLYDIR;
+        
+        if (defined('GLOB_BRACE')) {
+            $flags |= GLOB_BRACE;
+        }
+        
         // Ensure environment-specific path separators are normalized to URL separators
         return array_map(function ($val) {
             return rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $val), '/');
-        }, glob($this->url, GLOB_MARK | GLOB_ONLYDIR | GLOB_BRACE));
+        }, glob($this->url, $flags));
     }
 }