Commit c486cf41 authored by Carsten Brandt's avatar Carsten Brandt

added missing init() method to Cache class

parent b07b0c14
...@@ -70,6 +70,18 @@ abstract class Cache extends Component implements \ArrayAccess ...@@ -70,6 +70,18 @@ abstract class Cache extends Component implements \ArrayAccess
public $serializer; 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. * Builds a normalized cache key from a given key.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment