From 88371fb147dc68e8eaa728fbe8fe262006ab64a8 Mon Sep 17 00:00:00 2001 From: kidol Date: Wed, 27 May 2015 10:09:08 +0200 Subject: [PATCH] Trigger garbage collection in FileCache close #8569 --- framework/CHANGELOG.md | 1 + framework/caching/FileCache.php | 1 + 2 files changed, 2 insertions(+) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 5d21c23..8f1044d 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -14,6 +14,7 @@ Yii Framework 2 Change Log - Bug #8544: Fixed `yii\db\ActiveRecord` does not updates attribute specified at `optimisticLock()` after save (klimov-paul) - Bug: Fixed string comparison in `BaseActiveRecord::unlink()` which may result in wrong comparison result for hash valued primary keys starting with `0e` (cebe) - Bug: Pass correct action name to `yii\console\Controller::options()` when default action was requested (cebe) +- Bug: Automatic garbage collection in `yii\caching\FileCache` was not triggered (kidol) - Enh #6043: Specification for 'class' and 'style' in array format added to `yii\helpers\Html` (klimov-paul) - Enh #7169: `yii\widgets\ActiveField` now uses corresponding methods for default parts rendering (klimov-paul) - Enh #8070: `yii\console\controllers\MessageController` now sorts created messages, even if there is no new one, while saving to PHP file (klimov-paul) diff --git a/framework/caching/FileCache.php b/framework/caching/FileCache.php index deae61c..c499b01 100644 --- a/framework/caching/FileCache.php +++ b/framework/caching/FileCache.php @@ -125,6 +125,7 @@ class FileCache extends Cache */ protected function setValue($key, $value, $duration) { + $this->gc(); $cacheFile = $this->getCacheFile($key); if ($this->directoryLevel > 0) { @FileHelper::createDirectory(dirname($cacheFile), $this->dirMode, true);