Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Match cache file without glob

givanz463ab364450e
diff --git a/system/cache/file.php b/system/cache/file.php
index d9a11eb..db5396b 100755
--- a/system/cache/file.php
+++ b/system/cache/file.php
@@ -57,14 +57,10 @@ class File {
$namespace = $this->validateNamespace($namespace);
$key = $this->validateNamespace($key);
- $files = glob($this->cacheDir . $namespace . '.' . $this->cachePrefix . basename($key) . '.*');
-
- if ($files) {
- if (file_exists($files[0])) {
- $data = file_get_contents($files[0]);
-
- return json_decode($data, true);
- }
+ $file = $this->cacheDir . $namespace . '.' . $this->cachePrefix . basename($key);
+ if (file_exists($file)) {
+ $data = file_get_contents($file);
+ return json_decode($data, true);
}
return null;
@@ -126,7 +122,7 @@ class File {
}
if ($key) {
- $name .= $this->cachePrefix . basename($key) . '.*';
+ $name .= $this->cachePrefix . basename($key) . '*';
} else {
$name .= '*';
}