From: umherirrender Date: Sun, 24 Jun 2012 19:50:10 +0000 (+0200) Subject: Change some NS_IMAGE to NS_FILE X-Git-Tag: 1.31.0-rc.0~23239^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a9a71011ffebfe2ad53558d8f35bf1d1bf6b279d;p=lhc%2Fweb%2Fwiklou.git Change some NS_IMAGE to NS_FILE Change-Id: Id530c88d24df1a47a2f6565911184008b67fe04d --- diff --git a/includes/Export.php b/includes/Export.php index aa571f4178..36d98d681b 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -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 = ''; diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index ce5aac2d38..4ab4d72ad7 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -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 ); } } diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index fcb9c4bc20..9704b6d8d6 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -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; diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 969293b53c..4d2d04b589 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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 { diff --git a/languages/messages/MessagesMg.php b/languages/messages/MessagesMg.php index 08045b608e..25f5f77314 100644 --- a/languages/messages/MessagesMg.php +++ b/languages/messages/MessagesMg.php @@ -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, diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php index 77a371d520..59ba0a047e 100644 --- a/tests/phpunit/includes/SampleTest.php +++ b/tests/phpunit/includes/SampleTest.php @@ -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' ) ); }