Skip to content

Commit

Permalink
Fixed issue #13982 : (partial) some existing Yii cacche can not be used
Browse files Browse the repository at this point in the history
Dev: test existing method before use it.
  • Loading branch information
caseylucas authored and Shnoulle committed Sep 14, 2018
1 parent 16f6eb8 commit c0ef15f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -2383,9 +2383,12 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)

// Try to clear tmp/runtime (database cache files).
// Related to problems like https://bugs.limesurvey.org/view.php?id=13699.
if (!(defined('YII_DEBUG') && YII_DEBUG)) {
// Some cache implementations may not have 'flush' method. Only call flush if method exists.
if (method_exists(Yii::app()->cache, 'flush')) {
Yii::app()->cache->flush();
// NB: CDummyCache does not have a gc method (used if debug > 0).
}
// Some cache implementations (ex: CRedisCache, CDummyCache) may not have 'gc' method. Only call gc if method exists.
if (method_exists(Yii::app()->cache, 'gc')) {
Yii::app()->cache->gc();
}

Expand Down

0 comments on commit c0ef15f

Please sign in to comment.