We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f36981 commit aba5ffaCopy full SHA for aba5ffa
Cache.php
@@ -76,17 +76,7 @@ class Cache extends \yii\caching\Cache
76
public function init()
77
{
78
parent::init();
79
- if (is_string($this->redis)) {
80
- $this->redis = Yii::$app->get($this->redis);
81
- } elseif (is_array($this->redis)) {
82
- if (!isset($this->redis['class'])) {
83
- $this->redis['class'] = Connection::className();
84
- }
85
- $this->redis = Yii::createObject($this->redis);
86
87
- if (!$this->redis instanceof Connection) {
88
- throw new InvalidConfigException("Cache::redis must be either a Redis connection instance or the application component ID of a Redis connection.");
89
+ $this->redis = Instance::ensure($this->redis, Connection::className());
90
}
91
92
/**
0 commit comments