forked from GithubBackups/vichan
cache.php: use local vars
This commit is contained in:
parent
4d2f369af6
commit
12b4356a6a
@ -12,10 +12,10 @@ defined('TINYBOARD') or exit;
|
|||||||
class Cache {
|
class Cache {
|
||||||
private static function buildCache(): CacheDriver {
|
private static function buildCache(): CacheDriver {
|
||||||
global $config;
|
global $config;
|
||||||
// Determine if Redis is configured via environment variables
|
// Determine if the cache engine is configured via environment variables.
|
||||||
getenv('VICHAN_CACHE_ENGINE') && $config['cache']['enabled'] = getenv('VICHAN_CACHE_ENGINE');
|
$engine = \getenv('VICHAN_CACHE_ENGINE') ?: $config['cache']['enabled'];
|
||||||
|
|
||||||
switch ($config['cache']['enabled']) {
|
switch ($engine) {
|
||||||
case 'memcached':
|
case 'memcached':
|
||||||
return new MemcachedCacheDriver(
|
return new MemcachedCacheDriver(
|
||||||
$config['cache']['prefix'],
|
$config['cache']['prefix'],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user