mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
added missing init() method to Cache class
This commit is contained in:
@ -70,6 +70,18 @@ abstract class Cache extends Component implements \ArrayAccess
|
||||
public $serializer;
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the application component.
|
||||
* This method overrides the parent implementation by setting default cache key prefix.
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
if ($this->keyPrefix === null) {
|
||||
$this->keyPrefix = \Yii::$app->id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a normalized cache key from a given key.
|
||||
*
|
||||
|
Reference in New Issue
Block a user