From e0d2d91ef873c50a24a2a11ffe6e5617796cfe38 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 20 Jul 2016 14:10:02 -0700 Subject: [PATCH] DifferenceEngine: Move MW_DIFF_VERSION to class constant DIFF_VERSION Deprecated the former. It's only used in 2 extensions (both active), so we can probably get rid of this within a single release cycle. Change-Id: I39bef62556f8f0625a5741d54f9f84d15b50610d --- includes/diff/DifferenceEngine.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index af5fbf3346..bd7629acbd 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -21,12 +21,7 @@ * @ingroup DifferenceEngine */ -/** - * Constant to indicate diff cache compatibility. - * Bump this when changing the diff formatting in a way that - * fixes important bugs or such to force cached diff views to - * clear. - */ +// Deprecated, use class constant instead define( 'MW_DIFF_VERSION', '1.11a' ); /** @@ -34,6 +29,13 @@ define( 'MW_DIFF_VERSION', '1.11a' ); * @ingroup DifferenceEngine */ class DifferenceEngine extends ContextSource { + /** + * Constant to indicate diff cache compatibility. + * Bump this when changing the diff formatting in a way that + * fixes important bugs or such to force cached diff views to + * clear. + */ + const DIFF_VERSION = MW_DIFF_VERSION; /** @var int */ public $mOldid; @@ -777,7 +779,7 @@ class DifferenceEngine extends ContextSource { throw new MWException( 'mOldid and mNewid must be set to get diff cache key.' ); } - return wfMemcKey( 'diff', 'version', MW_DIFF_VERSION, + return wfMemcKey( 'diff', 'version', self::MW_DIFF_VERSION, 'oldid', $this->mOldid, 'newid', $this->mNewid ); } -- 2.20.1