From: Seamus Lee Date: Sat, 22 Jun 2019 03:46:10 +0000 (+1000) Subject: Add in utility function for resetting ACL and System Level Caches X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=33660480609850cf47b39b5414e0d31e484b3cfb;p=civicrm-core.git Add in utility function for resetting ACL and System Level Caches --- diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index fe41bd06cc..ef2bc60eee 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -242,14 +242,22 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { } if ($clearAll) { - // also reset ACL Cache - CRM_ACL_BAO_Cache::resetCache(); - - // also reset memory cache if any - CRM_Utils_System::flushCache(); + self::resetCaches(); } } + /** + * Cleanup ACL and System Level caches + */ + public static function resetCaches() { + // also reset ACL Cache + // @todo why is this called when CRM_Utils_System::flushCache() does it as well. + CRM_ACL_BAO_Cache::resetCache(); + + // also reset memory cache if any + CRM_Utils_System::flushCache(); + } + /** * The next two functions are internal functions used to store and retrieve session from * the database cache. This keeps the session to a limited size and allows us to