Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 28 Sep 2016 03:29:54 +0000 (20:29 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 28 Sep 2016 03:40:17 +0000 (20:40 -0700)
Hopefully this will discourage people from using them in new code.

Change-Id: I165a19406dfc0bcc471252e416480fa3af92d969

includes/Defines.php
tests/parser/ParserTestRunner.php

index 529dfb3..02930ea 100644 (file)
@@ -77,8 +77,13 @@ define( 'NS_CATEGORY_TALK', 15 );
  * When writing code that should be compatible with older MediaWiki
  * versions, either stick to the old names or define the new constants
  * yourself, if they're not defined already.
+ *
+ * @deprecated since 1.14
  */
 define( 'NS_IMAGE', NS_FILE );
+/**
+ * @deprecated since 1.14
+ */
 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
 /**@}*/
 
index 369cd0e..6ca851e 100644 (file)
@@ -1524,7 +1524,7 @@ class ParserTestRunner {
                }
 
                // The RepoGroup cache is invalidated by the creation of file redirects
-               if ( $title->getNamespace() === NS_IMAGE ) {
+               if ( $title->inNamespace( NS_FILE ) ) {
                        RepoGroup::singleton()->clearCache( $title );
                }
        }