From: Stanislav Malyshev Date: Thu, 15 Mar 2018 22:36:47 +0000 (-0700) Subject: Add cleanup for handlers cache. X-Git-Tag: 1.31.0-rc.0~370^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=9a3d33107b6aa71eb472721626971c466cc23219;p=lhc%2Fweb%2Fwiklou.git Add cleanup for handlers cache. This is useful if we want to override certain handler for testing but have no way to remove it from cache otherwise. Change-Id: Icb4f9360c6e7684d15e91a7009a5a3a3e2febb37 --- diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index eab3afb966..3cfac8f90b 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -332,6 +332,13 @@ abstract class ContentHandler { return self::$handlers[$modelId]; } + /** + * Clean up handlers cache. + */ + public static function cleanupHandlersCache() { + self::$handlers = []; + } + /** * Returns the localized name for a given content model. *