From: aude Date: Mon, 17 Mar 2014 21:48:27 +0000 (+0100) Subject: Put SiteList navigation ids into cache X-Git-Tag: 1.31.0-rc.0~16585^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=4f02f5fbb7928aff11397b8c55295088b663ddb5;p=lhc%2Fweb%2Fwiklou.git Put SiteList navigation ids into cache These are ids used by extension(s) such as Wikibase to add language links in the sidebar. Bug: 62754 Change-Id: Ie21fc3ea500bd7de3c01a9d8ec05373f016f339a --- diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index 1dd6b1630c..a7c196b45b 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -297,7 +297,7 @@ class SiteList extends GenericArrayObject { * @var string A string uniquely identifying the version of the serialization structure, * not including any sub-structures. */ - const SERIAL_VERSION_ID = '2013-02-07'; + const SERIAL_VERSION_ID = '2014-03-17'; /** * Returns the version ID that identifies the serialization structure used by @@ -327,6 +327,7 @@ class SiteList extends GenericArrayObject { array( 'internalIds' => $this->byInternalId, 'globalIds' => $this->byGlobalId, + 'navigationIds' => $this->byNavigationId ) ); } @@ -345,6 +346,7 @@ class SiteList extends GenericArrayObject { $this->byInternalId = $serializationData['internalIds']; $this->byGlobalId = $serializationData['globalIds']; + $this->byNavigationId = $serializationData['navigationIds']; return $serializationData; } diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php index b41f647e90..61d0ace0d7 100644 --- a/tests/phpunit/includes/site/SiteListTest.php +++ b/tests/phpunit/includes/site/SiteListTest.php @@ -228,6 +228,13 @@ class SiteListTest extends MediaWikiTestCase { */ foreach ( $list as $site ) { $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) ); + + foreach( $site->getNavigationIds() as $navId ) { + $this->assertTrue( + $copy->hasNavigationId( $navId ), + 'unserialized data expects nav id ' . $navId . ' for site ' . $site->getGlobalId() + ); + } } } }