Skip to content

Commit

Permalink
issue: Flush Model Cache
Browse files Browse the repository at this point in the history
This addresses an issue where `ModelMeta::flushModelCache()` doesn't work
correctly. In theory, it's supposed to clear all APCu cache. This is
especially helpful for Upgrades by preventing the selection of
data/structures that don't exist anymore. This is due to the fact that when
we updated `apc_clear_cache()` to `apcu_clear_cache()` we forgot to remove
the argument. `apcu_clear_cache()` takes no arguments and you would think
that PHP would be smart enough to void the argument but apparently it's not.
This removes the argument so that it works properly and clears all APCu
cache.
  • Loading branch information
JediKev committed May 7, 2020
1 parent 741122a commit db5eb07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/class.orm.php
Expand Up @@ -298,7 +298,7 @@ function inspectFields() {

static function flushModelCache() {
if (self::$model_cache)
@apcu_clear_cache('user');
@apcu_clear_cache();
}
}

Expand Down

0 comments on commit db5eb07

Please sign in to comment.