We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f3e8f25 + eae78dc commit 2e9afb2Copy full SHA for 2e9afb2
lib/internal/Magento/Framework/Filesystem/Glob.php
@@ -14,6 +14,7 @@
14
*/
15
class Glob extends LaminasGlob
16
{
17
+ private static $cache = [];
18
/**
19
* Find pathnames matching a pattern.
20
*
@@ -24,11 +25,16 @@ class Glob extends LaminasGlob
24
25
26
public static function glob($pattern, $flags = 0, $forceFallback = false)
27
28
+ $key = $pattern . '|' . $flags . '|' . ($forceFallback ? 1 : 0);
29
+ if (isset(self::$cache[$key])) {
30
+ return self::$cache[$key];
31
+ }
32
try {
33
$result = LaminasGlob::glob($pattern, $flags, $forceFallback);
34
} catch (LaminasRuntimeException $e) {
35
$result = [];
36
}
37
+ self::$cache[$key] = $result;
38
return $result;
39
40
0 commit comments