Change some NS_IMAGE to NS_FILE
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 24 Jun 2012 19:50:10 +0000 (21:50 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 24 Jun 2012 19:50:10 +0000 (21:50 +0200)
Change-Id: Id530c88d24df1a47a2f6565911184008b67fe04d

includes/Export.php
includes/api/ApiQueryAllImages.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryImageInfo.php
languages/messages/MessagesMg.php
tests/phpunit/includes/SampleTest.php

index aa571f4..36d98d6 100644 (file)
@@ -757,7 +757,7 @@ class XmlDumpWriter {
         * @return string
         */
        function writeUploads( $row, $dumpContents = false ) {
-               if ( $row->page_namespace == NS_IMAGE ) {
+               if ( $row->page_namespace == NS_FILE ) {
                        $img = wfLocalFile( $row->page_title );
                        if ( $img && $img->exists() ) {
                                $out = '';
index ce5aac2..4ab4d72 100644 (file)
@@ -165,7 +165,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                                        break;
                                }
                        } else {
-                               $titles[] = Title::makeTitle( NS_IMAGE, $row->img_name );
+                               $titles[] = Title::makeTitle( NS_FILE, $row->img_name );
                        }
                }
 
index fcb9c4b..9704b6d 100644 (file)
@@ -277,7 +277,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                        if ( $this->hasNS ) {
                                                $parentID = $this->pageMap[$row-> { $this->bl_ns } ][$row-> { $this->bl_title } ];
                                        } else {
-                                               $parentID = $this->pageMap[NS_IMAGE][$row-> { $this->bl_title } ];
+                                               $parentID = $this->pageMap[NS_FILE][$row-> { $this->bl_title } ];
                                        }
                                        $this->continueStr = $this->getContinueRedirStr( $parentID, $row->page_id );
                                        break;
index 969293b..4d2d04b 100644 (file)
@@ -81,14 +81,14 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                }
 
                                $start = $skip ? $fromTimestamp : $params['start'];
-                               $pageId = $pageIds[NS_IMAGE][ $img->getOriginalTitle()->getDBkey() ];
+                               $pageId = $pageIds[NS_FILE][ $img->getOriginalTitle()->getDBkey() ];
 
                                $fit = $result->addValue(
                                        array( 'query', 'pages', intval( $pageId ) ),
                                        'imagerepository', $img->getRepoName()
                                );
                                if ( !$fit ) {
-                                       if ( count( $pageIds[NS_IMAGE] ) == 1 ) {
+                                       if ( count( $pageIds[NS_FILE] ) == 1 ) {
                                                // The user is screwed. imageinfo can't be solely
                                                // responsible for exceeding the limit in this case,
                                                // so set a query-continue that just returns the same
@@ -119,7 +119,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                                self::getInfo( $img, $prop, $result,
                                                        $finalThumbParams, $params['metadataversion'] ) );
                                        if ( !$fit ) {
-                                               if ( count( $pageIds[NS_IMAGE] ) == 1 ) {
+                                               if ( count( $pageIds[NS_FILE] ) == 1 ) {
                                                        // See the 'the user is screwed' comment above
                                                        $this->setContinueEnumParameter( 'start',
                                                                wfTimestamp( TS_ISO_8601, $img->getTimestamp() ) );
@@ -149,7 +149,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                                self::getInfo( $oldie, $prop, $result,
                                                        $finalThumbParams, $params['metadataversion'] ) );
                                        if ( !$fit ) {
-                                               if ( count( $pageIds[NS_IMAGE] ) == 1 ) {
+                                               if ( count( $pageIds[NS_FILE] ) == 1 ) {
                                                        $this->setContinueEnumParameter( 'start',
                                                                wfTimestamp( TS_ISO_8601, $oldie->getTimestamp() ) );
                                                } else {
index 08045b6..25f5f77 100644 (file)
@@ -110,7 +110,7 @@ $namespaceAliases = array(
        'Utilisateur' => NS_USER,
        'Discussion_Utilisateur' => NS_USER_TALK,
        'Discussion_$1' => NS_PROJECT_TALK,
-       'Discussion_Image' => NS_IMAGE_TALK,
+       'Discussion_Image' => NS_FILE_TALK,
        'Discussion_MediaWiki' => NS_MEDIAWIKI_TALK,
        'Modèle' => NS_TEMPLATE,
        'Discussion_Modèle' => NS_TEMPLATE_TALK,
index 77a371d..59ba0a0 100644 (file)
@@ -47,7 +47,7 @@ class TestSample extends MediaWikiLangTestCase {
                        array( 'Text', null, 'Text' ),
                        array( 'text', null, 'Text' ),
                        array( 'Text', NS_USER, 'User:Text' ),
-                       array( 'Photo.jpg', NS_IMAGE, 'File:Photo.jpg' )
+                       array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' )
                );
        }