Commit 3bed48ec by Qiang Xue

Merge branch 'master' of git.yiisoft.com:yii2

parents 5fd27b7c 6a420079
......@@ -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.
*
* 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