Commit c486cf41 by Carsten Brandt

added missing init() method to Cache class

parent b07b0c14
...@@ -71,6 +71,18 @@ abstract class Cache extends Component implements \ArrayAccess ...@@ -71,6 +71,18 @@ abstract class Cache extends Component implements \ArrayAccess
/** /**
* 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.
* *
* The generated key contains letters and digits only, and its length is no more than 32. * The generated key contains letters and digits only, and its length is no more than 32.
......
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