If the last modification time of the file specified via [[fileName]] is changed, the dependency is considered as changed. For more details and usage information on Cache, see the guide article on caching.
Since: 2.0
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends yii\caching\Dependency
コード例 #1
0
 /**
  * @inheritdoc
  */
 public function getHasChanged($cache)
 {
     $result = parent::getHasChanged($cache);
     if ($result && $this->compiledFileName) {
         @unlink($this->compiledFileName);
         FileHelper::removeDirIfEmpty(dirname($this->compiledFileName));
     }
     return $result;
 }