From 06e88b3134749a35e3d08c863c8adff202599be0 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 11 Apr 2019 14:21:41 +0300 Subject: [PATCH] Fix docs for MWNamespace::clearCaches() removal Originally I had intended setMwGlobals() to magically reset the namespace-related services if namespace-related settings were changed, but Tim told me to remove it during review and I forgot to update the release notes. Moving forward, everyone will need to reset services after every config change to ensure correctness, and there's no point in trying to reset specific services automatically as special cases. I also moved the note to the 1.34 notes, since this missed the cutoff and should not be backported. Change-Id: Ib7cbdaef22a15ddfc7aaf99d0972b99d3cddc011 --- RELEASE-NOTES-1.33 | 8 -------- RELEASE-NOTES-1.34 | 8 ++++++++ includes/MWNamespace.php | 2 +- includes/MediaWikiServices.php | 2 +- includes/title/NamespaceInfo.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index e28957daff..db5fea0c82 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -359,13 +359,6 @@ because of Phabricator reports. * MessageBlobStore::getBlob(), deprecated in 1.27, has been removed. Use ::getBlobs() instead. * The .background-size() LESS mixin, deprecated in 1.27, has been removed. -* MWNamespace::clearCaches() has been removed. So has the $rebuild parameter - to MWNamespace::getCanonicalNamespaces(), which was deprecated since 1.31. - Instead, create a new NamespaceInfo, such as by calling - resetServiceForTesting( 'NamespaceInfo' ) on a MediaWikiServices. - For classes that inherit from MediaWikiTestCase and used setMwGlobals() to - modify a variable that affects namespaces, caches will automatically be - reset and any calls to MWNamespace::clearCaches() can be removed entirely. * ReadOnlyMode::clearCache() and ConfiguredReadOnlyMode::clearCache() have been removed. Use MediaWikiTestCase::overrideMwServices() instead. @@ -436,7 +429,6 @@ because of Phabricator reports. * Block::isValid is deprecated, since it is no longer needed in core. * Calling Maintenance::hasArg() as well as Maintenance::getArg() with no parameter has been deprecated. Please pass the argument number 0. -* The MWNamespace class is deprecated. Use MediaWikiServices::getNamespaceInfo. * ResourceLoaderContext::expandModuleNames has been deprecated. Use ResourceLoader::expandModuleNames instead. diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index cc0a745527..b1a2ed01ff 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -75,9 +75,17 @@ because of Phabricator reports. * Functions of the MWCryptRand class: singleton(), wasStrong() and generate(). * Language::setCode, deprecated in 1.32, was removed. Use Language::factory to create a new Language object with a different language code. +* MWNamespace::clearCaches() has been removed. So has the $rebuild parameter + to MWNamespace::getCanonicalNamespaces(), which was deprecated since 1.31. + Instead, reset services, such as by calling $this->overrideMwServices() (if + your test extends MediaWikiTestCase). Services will generally not pick up + configuration changes from after they were created, so you must reset + services after any configuration change. Even if your code works now, it is + likely to break in future versions as more code is moved to services. * … === Deprecations in 1.34 === +* The MWNamespace class is deprecated. Use MediaWikiServices::getNamespaceInfo. * … === Other changes in 1.34 === diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php index a36a12fcd3..1529473a92 100644 --- a/includes/MWNamespace.php +++ b/includes/MWNamespace.php @@ -22,7 +22,7 @@ use MediaWiki\MediaWikiServices; /** - * @deprecated since 1.33, use NamespaceInfo instead + * @deprecated since 1.34, use NamespaceInfo instead */ class MWNamespace { /** diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index c296a72cf8..655946f51d 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -667,7 +667,7 @@ class MediaWikiServices extends ServiceContainer { } /** - * @since 1.33 + * @since 1.34 * @return NamespaceInfo */ public function getNamespaceInfo() : NamespaceInfo { diff --git a/includes/title/NamespaceInfo.php b/includes/title/NamespaceInfo.php index 3726202d31..f9cab24458 100644 --- a/includes/title/NamespaceInfo.php +++ b/includes/title/NamespaceInfo.php @@ -24,7 +24,7 @@ * This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of * them based on index. The textual names of the namespaces are handled by Language.php. * - * @since 1.33 + * @since 1.34 */ class NamespaceInfo { -- 2.20.1