Closed ghost closed 7 years ago
Turns out Redis support was removed from Yii 2, and moved into a separate extension. It should be possible to Composer-install that extension yourself and make the application config adjustments it requires via config/app.php
, so I just updated the cacheMethod
comment to not include redis
anymore.
@brandonkelly FYI, you can't use that Redis Yii extension because Craft validates the cacheMethod here:
// Validate cacheMethod
if (!in_array($this->cacheMethod, [self::CACHE_METHOD_APC, self::CACHE_METHOD_DB, self::CACHE_METHOD_FILE, self::CACHE_METHOD_MEMCACHE, self::CACHE_METHOD_WINCACHE, self::CACHE_METHOD_XCACHE, self::CACHE_METHOD_ZENDDATA], true)) {
throw new InvalidConfigException('Unsupported cacheMethod value: '.$this->cacheMethod);
}
Any chance of making redis an first-class option again?
There’s no need to change the cacheMethod
value. Your config/app.php
file will be completely overriding Craft’s cache
component definition, which is the only place that checks the cacheMethod
setting.
Here’s what your config/app.php
might look like:
return [
'components' => [
'cache' => [
'class' => yii\redis\Cache::class,
'redis' => [
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,
],
],
],
];
Description
In the comments in the config files, it mentions redis as a cache option, but it's coming back as an unsupported cache type.
Missing in https://github.com/craftcms/cms/blob/develop/src/config/components/common.php#L129
Steps to reproduce
\InvalidArgumentException
Additional info