瀏覽代碼

Update FileCache

Save the polls cache in the /polls/ subdirectory.
Visman 4 年之前
父節點
當前提交
433057e823
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      app/Core/Cache/FileCache.php

+ 5 - 2
app/Core/Cache/FileCache.php

@@ -203,8 +203,11 @@ class FileCache implements CacheInterface
         if (! \preg_match('%^[a-z0-9_\.]+$%Di', $key)) {
             throw new InvalidArgumentException('Key is not a legal value');
         }
-
-        return $this->cacheDir . "/cache_{$key}.php";
+        if ('poll' == \substr($key, 0, 4)) {
+            return $this->cacheDir . "/polls/cache_{$key}.php";
+        } else {
+            return $this->cacheDir . "/cache_{$key}.php";
+        }
     }
 
     /**