Foxtrott has submitted this change and it was merged.

Change subject: Add version number to cache key to avoid loading incompatible 
trees
......................................................................


Add version number to cache key to avoid loading incompatible trees

Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
---
M src/LingoParser.php
M src/Tree.php
2 files changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Foxtrott: Verified; Looks good to me, approved



diff --git a/src/LingoParser.php b/src/LingoParser.php
index 524e4e1..5c3e4d6 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -131,7 +131,7 @@
                                // Try cache first
                                global $wgexLingoCacheType;
                                $cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-                               $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree' );
+                               $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
                                $cachedLingoTree = $cache->get( $cachekey );
 
                                // cache hit?
diff --git a/src/Tree.php b/src/Tree.php
index ccb3c6d..4021e3c 100644
--- a/src/Tree.php
+++ b/src/Tree.php
@@ -50,6 +50,8 @@
  */
 class Tree {
 
+       const TREE_VERSION = 2;
+
        private $mTree = array();
        private $mList = array();
        private $mMinLength = 1000;

-- 
To view, visit https://gerrit.wikimedia.org/r/276981
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>
Gerrit-Reviewer: Foxtrott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to