Fix docs for MWNamespace::clearCaches() removal
authorAryeh Gregor <ayg@aryeh.name>
Thu, 11 Apr 2019 11:21:41 +0000 (14:21 +0300)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 11 Apr 2019 22:47:54 +0000 (23:47 +0100)
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
RELEASE-NOTES-1.34
includes/MWNamespace.php
includes/MediaWikiServices.php
includes/title/NamespaceInfo.php

index e28957d..db5fea0 100644 (file)
@@ -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.
 
index cc0a745..b1a2ed0 100644 (file)
@@ -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 ===
index a36a12f..1529473 100644 (file)
@@ -22,7 +22,7 @@
 use MediaWiki\MediaWikiServices;
 
 /**
- * @deprecated since 1.33, use NamespaceInfo instead
+ * @deprecated since 1.34, use NamespaceInfo instead
  */
 class MWNamespace {
        /**
index c296a72..655946f 100644 (file)
@@ -667,7 +667,7 @@ class MediaWikiServices extends ServiceContainer {
        }
 
        /**
-        * @since 1.33
+        * @since 1.34
         * @return NamespaceInfo
         */
        public function getNamespaceInfo() : NamespaceInfo {
index 3726202..f9cab24 100644 (file)
@@ -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 {