This step simply defines the new constants NS_FILE and NS_FILE_TALK, retaining NS_IMAGE and NS_IMAGE_TALK as aliases, and makes them usable for export (which seems to be the only part of core that uses the NS_* names as strings).
The second step should be a global search-and-replace across core (other than Defines.php and Export.php). I've already tried this locally, and there seem to be no problems. This step should not touch extensions.
The third, optional step would be updating at least some extensions to use the new constant names as well. This would generally require prepending the following compatibility snippet to the main extension file:
// The names NS_FILE and NS_FILE_TALK are new in MediaWiki v1.14
if( !defined('NS_FILE') || !defined('NS_FILE_TALK') ) {
define('NS_FILE', NS_IMAGE);
define('NS_FILE_TALK', NS_IMAGE_TALK);
}
on the user's real name if one is set. Defaults to false (use the username)
* Removed the 'apiThumbCacheDir' option from $wgForeignFileRepos (only used in
ForeignAPIRepo)
-* Image namespace and accompanying talk namespace renamed to File. For backward
- compatibility purposes, Image still works. External tools may need to be
- updated.
+* (bug 44) Image namespace and accompanying talk namespace renamed to File.
+ For backward compatibility purposes, Image still works. External tools may
+ need to be updated.
+* The constants NS_FILE and NS_FILE_TALK can now be used instead of NS_IMAGE and
+ NS_IMAGE_TALK. The old constants are retained as aliases for compatibility.
* MediaWiki can be forced to use private IPs forwarded by a proxy server by
using $wgUsePrivateIPs.
define('NS_USER_TALK', 3);
define('NS_PROJECT', 4);
define('NS_PROJECT_TALK', 5);
-define('NS_IMAGE', 6);
-define('NS_IMAGE_TALK', 7);
+define('NS_FILE', 6);
+define('NS_FILE_TALK', 7);
define('NS_MEDIAWIKI', 8);
define('NS_MEDIAWIKI_TALK', 9);
define('NS_TEMPLATE', 10);
define('NS_HELP_TALK', 13);
define('NS_CATEGORY', 14);
define('NS_CATEGORY_TALK', 15);
+/**
+ * NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
+ * NS_FILE_TALK respectively, and are kept for compatibility.
+ *
+ * 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.
+ */
+define('NS_IMAGE', NS_FILE);
+define('NS_IMAGE_TALK', NS_FILE_TALK);
/**#@-*/
/**
"NS_USER_TALK" => NS_USER_TALK,
"NS_PROJECT" => NS_PROJECT,
"NS_PROJECT_TALK" => NS_PROJECT_TALK,
- "NS_IMAGE" => NS_IMAGE,
+ "NS_FILE" => NS_FILE,
+ "NS_FILE_TALK" => NS_FILE_TALK,
+ "NS_IMAGE" => NS_IMAGE, // NS_IMAGE is an alias for NS_FILE
"NS_IMAGE_TALK" => NS_IMAGE_TALK,
"NS_MEDIAWIKI" => NS_MEDIAWIKI,
"NS_MEDIAWIKI_TALK" => NS_MEDIAWIKI_TALK,