Update FileCache

Save the polls cache in the /polls/ subdirectory.
This commit is contained in:
Visman 2020-11-25 19:14:20 +07:00
parent 1b7e38c273
commit 433057e823

View file

@ -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";
}
}
/**