Merge "Wrap some long strings in tests/"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 26 Sep 2015 21:52:43 +0000 (21:52 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 26 Sep 2015 21:52:43 +0000 (21:52 +0000)
22 files changed:
includes/EditPage.php
includes/Html.php
includes/OutputPage.php
includes/db/DatabaseSqlite.php
includes/db/loadbalancer/LoadMonitorMySQL.php
includes/debug/logger/LegacyLogger.php
includes/htmlform/HTMLButtonField.php
includes/media/WebP.php
includes/parser/MWTidy.php
includes/registration/ExtensionRegistry.php
includes/resourceloader/ResourceLoader.php
includes/specials/SpecialChangeContentModel.php
includes/utils/BatchRowIterator.php
includes/utils/FileContentsHasher.php
resources/Resources.php
tests/phpunit/includes/UserTest.php
tests/phpunit/includes/filebackend/SwiftFileBackendTest.php
tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php
tests/phpunit/maintenance/backupPrefetchTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js
thumb.php

index 05e0ac0..89b484c 100644 (file)
@@ -3705,7 +3705,7 @@ HTML
                $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
                $showSignature = true;
                if ( $title ) {
-                        $showSignature = MWNamespace::wantSignatures( $title->getNamespace() );
+                       $showSignature = MWNamespace::wantSignatures( $title->getNamespace() );
                }
 
                /**
index 62ae0b8..c61dca8 100644 (file)
@@ -857,7 +857,7 @@ class Html {
                        } elseif ( is_int( $nsId ) ) {
                                $nsName = $wgContLang->convertNamespace( $nsId );
                        }
-                       $optionsOut[ $nsId ] = $nsName;
+                       $optionsOut[$nsId] = $nsName;
                }
 
                return $optionsOut;
index 552e181..336e4f4 100644 (file)
@@ -3973,7 +3973,7 @@ class OutputPage extends ContextSource {
                $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
                // Make keys (skin names) lowercase for case-insensitive matching.
                $themes = array_change_key_case( $themes, CASE_LOWER );
-               $theme = isset( $themes[ $skinName ] ) ? $themes[ $skinName ] : 'MediaWiki';
+               $theme = isset( $themes[$skinName] ) ? $themes[$skinName] : 'MediaWiki';
                // For example, 'OOUI\MediaWikiTheme'.
                $themeClass = "OOUI\\{$theme}Theme";
                OOUI\Theme::setSingleton( new $themeClass() );
index 7ece56d..0a7629e 100644 (file)
@@ -985,7 +985,7 @@ class DatabaseSqlite extends DatabaseBase {
                        $indexInfo = $this->query( 'PRAGMA INDEX_INFO(' . $this->addQuotes( $index->name ) . ')' );
                        $fields = array();
                        foreach ( $indexInfo as $indexInfoRow ) {
-                               $fields[ $indexInfoRow->seqno ] = $indexInfoRow->name;
+                               $fields[$indexInfoRow->seqno] = $indexInfoRow->name;
                        }
 
                        $sql .= '(' . implode( ',', $fields ) . ')';
index 3008419..39ced1b 100644 (file)
@@ -58,7 +58,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                # (a) Check the local APC cache
                $value = $this->srvCache->get( $key );
                if ( $value && $value['timestamp'] > ( microtime( true ) - $ttl ) ) {
-                       wfDebugLog( 'replication',  __FUNCTION__ . ": got lag times ($key) from local cache" );
+                       wfDebugLog( 'replication', __FUNCTION__ . ": got lag times ($key) from local cache" );
                        return $value['lagTimes']; // cache hit
                }
                $staleValue = $value ?: false;
@@ -67,7 +67,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                $value = $this->mainCache->get( $key );
                if ( $value && $value['timestamp'] > ( microtime( true ) - $ttl ) ) {
                        $this->srvCache->set( $key, $value, $staleTTL );
-                       wfDebugLog( 'replication',  __FUNCTION__ . ": got lag times ($key) from main cache" );
+                       wfDebugLog( 'replication', __FUNCTION__ . ": got lag times ($key) from main cache" );
 
                        return $value['lagTimes']; // cache hit
                }
@@ -106,7 +106,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                $value = array( 'lagTimes' => $lagTimes, 'timestamp' => microtime( true ) );
                $this->mainCache->set( $key, $value, $staleTTL );
                $this->srvCache->set( $key, $value, $staleTTL );
-               wfDebugLog( 'replication',  __FUNCTION__ . ": re-calculated lag times ($key)" );
+               wfDebugLog( 'replication', __FUNCTION__ . ": re-calculated lag times ($key)" );
 
                return $value['lagTimes'];
        }
index 0f4c648..bb3c7e1 100644 (file)
@@ -357,7 +357,7 @@ class LegacyLogger extends AbstractLogger {
                }
 
                if ( is_scalar( $item ) ) {
-                       return (string) $item;
+                       return (string)$item;
                }
 
                if ( is_array( $item ) ) {
@@ -376,7 +376,7 @@ class LegacyLogger extends AbstractLogger {
 
                if ( is_object( $item ) ) {
                        if ( method_exists( $item, '__toString' ) ) {
-                               return (string) $item;
+                               return (string)$item;
                        }
 
                        return '[Object ' . get_class( $item ) . ']';
index 56a23ad..5a1006a 100644 (file)
@@ -15,8 +15,9 @@ class HTMLButtonField extends HTMLFormField {
 
        public function __construct( $info ) {
                $info['nodata'] = true;
-               if ( isset( $info['flags'] ) )
+               if ( isset( $info['flags'] ) ) {
                        $this->mFlags = $info['flags'];
+               }
                parent::__construct( $info );
        }
 
@@ -28,7 +29,7 @@ class HTMLButtonField extends HTMLFormField {
                ) {
                        $prefix = 'mw-ui-';
                        // add mw-ui-button separately, so the descriptor doesn't need to set it
-                       $flags .= ' ' . $prefix.'button';
+                       $flags .= ' ' . $prefix . 'button';
                }
                foreach ( $this->mFlags as $flag ) {
                        $flags .= ' ' . $prefix . $flag;
index ff4dcee..f894618 100644 (file)
@@ -102,7 +102,7 @@ class WebPHandler extends BitmapHandler {
 
                if ( $info['fourCC'] != 'WEBP' ) {
                        wfDebugLog( 'WebP', __METHOD__ . ': FourCC was not WEBP: ' .
-                               bin2hex( $info['fourCC'] ) .  " \n" );
+                               bin2hex( $info['fourCC'] ) . " \n" );
                        return false;
                }
 
@@ -187,7 +187,7 @@ class WebPHandler extends BitmapHandler {
                // Bytes 4-7 are chunk stream size
                // Byte 8 is 0x2F called the signature
                if ( $header{8} != "\x2F" ) {
-                       wfDebugLog( 'WebP',  __METHOD__ . ': Invalid signature: ' .
+                       wfDebugLog( 'WebP', __METHOD__ . ': Invalid signature: ' .
                                bin2hex( $header{8} ) . "\n" );
                        return array();
                }
index 807842b..3a2bb17 100644 (file)
@@ -45,7 +45,7 @@ class MWTidy {
        public static function tidy( $text ) {
                $driver = self::singleton();
                if ( !$driver ) {
-                       throw new MWException( __METHOD__.
+                       throw new MWException( __METHOD__ .
                                ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
                }
                return $driver->tidy( $text );
@@ -61,7 +61,7 @@ class MWTidy {
        public static function checkErrors( $text, &$errorStr = null ) {
                $driver = self::singleton();
                if ( !$driver ) {
-                       throw new MWException( __METHOD__.
+                       throw new MWException( __METHOD__ .
                                ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
                }
                if ( $driver->supportsValidate() ) {
index f91aeff..59b9249 100644 (file)
@@ -204,7 +204,7 @@ class ExtensionRegistry {
                        ) {
                                // Doesn't match, mark it as incompatible.
                                $incompatible[] = "{$info['name']} is not compatible with the current "
-                                       . "MediaWiki core (version {$wgVersion}), it requires: ". $requires[self::MEDIAWIKI_CORE]
+                                       . "MediaWiki core (version {$wgVersion}), it requires: " . $requires[self::MEDIAWIKI_CORE]
                                        . '.';
                                continue;
                        }
index ab36701..4a9cd0e 100644 (file)
@@ -747,7 +747,7 @@ class ResourceLoader implements LoggerAwareInterface {
 
                if ( $context->getImageObj() && $this->errors ) {
                        // We can't show both the error messages and the response when it's an image.
-                       $response = implode( "\n\n",  $this->errors );
+                       $response = implode( "\n\n", $this->errors );
                } elseif ( $this->errors ) {
                        $errorText = implode( "\n\n", $this->errors );
                        $errorResponse = self::makeComment( $errorText );
index cce5da5..b0def59 100644 (file)
@@ -139,7 +139,7 @@ class SpecialChangeContentModel extends FormSpecialPage {
                        throw new RuntimeException( "Form submission was not POSTed" );
                }
 
-               $this->title = Title::newFromText( $data['pagetitle' ] );
+               $this->title = Title::newFromText( $data['pagetitle'] );
                $user = $this->getUser();
                // Check permissions and make sure the user has permission to edit the specific page
                $errors = $this->title->getUserPermissionsErrors( 'editcontentmodel', $user );
index 9441608..fb2ae2a 100644 (file)
@@ -90,7 +90,7 @@ class BatchRowIterator implements RecursiveIterator {
                }
                $this->db = $db;
                $this->table = $table;
-               $this->primaryKey = (array) $primaryKey;
+               $this->primaryKey = (array)$primaryKey;
                $this->fetchColumns = $this->primaryKey;
                $this->orderBy = implode( ' ASC,', $this->primaryKey ) . ' ASC';
                $this->batchSize = $batchSize;
@@ -169,7 +169,7 @@ class BatchRowIterator implements RecursiveIterator {
         * @return boolean True when the iterator is in a valid state
         */
        public function valid() {
-               return (bool) $this->current;
+               return (bool)$this->current;
        }
 
        /**
index 67eb9d2..655c1d0 100644 (file)
@@ -93,7 +93,7 @@ class FileContentsHasher {
                $instance = self::singleton();
 
                if ( !is_array( $filePaths ) ) {
-                       $filePaths = (array) $filePaths;
+                       $filePaths = (array)$filePaths;
                }
 
                if ( count( $filePaths ) === 1 ) {
index 6aeb206..335775f 100644 (file)
@@ -1381,7 +1381,8 @@ return array(
        ),
        'mediawiki.action.view.filepage' => array(
                'styles' => array(
-                       'resources/src/mediawiki.action/mediawiki.action.view.filepage.print.css' => array( 'media' => 'print' ),
+                       'resources/src/mediawiki.action/mediawiki.action.view.filepage.print.css' =>
+                               array( 'media' => 'print' ),
                        'resources/src/mediawiki.action/mediawiki.action.view.filepage.css',
                ),
                'position' => 'top',
@@ -1774,7 +1775,8 @@ return array(
                        // @todo: Remove mediawiki.page.gallery when cache has cleared
                        'resources/src/mediawiki.page/mediawiki.page.gallery.print.css' => array( 'media' => 'print' ),
                        // @todo: Remove mediawiki.action.view.filepage.print.css when cache has cleared
-                       'resources/src/mediawiki.action/mediawiki.action.view.filepage.print.css' => array( 'media' => 'print' ),
+                       'resources/src/mediawiki.action/mediawiki.action.view.filepage.print.css' =>
+                               array( 'media' => 'print' ),
                        'resources/src/mediawiki.legacy/commonPrint.css' => array( 'media' => 'print' )
                ),
        ),
index 77132bb..17c1b8e 100644 (file)
@@ -527,7 +527,7 @@ class UserTest extends MediaWikiTestCase {
 
                $setcookieInvocations = $setcookieSpy->getInvocations();
                $setcookieInvocation = end( $setcookieInvocations );
-               $actualExpiry = $setcookieInvocation->parameters[ 2 ];
+               $actualExpiry = $setcookieInvocation->parameters[2];
 
                // TODO: ± 300 seconds compensates for
                // slow-running tests. However, the dependency on the time
index adcbe74..a683750 100644 (file)
@@ -75,7 +75,7 @@ class SwiftFileBackendTest extends MediaWikiTestCase {
                                array(
                                        'content-length' => 345,
                                        'content-type'   => 'image+bitmap/jpeg',
-                                       'content-disposition' => 'filename='. str_repeat( 'o', 1024 ) . ';inline',
+                                       'content-disposition' => 'filename=' . str_repeat( 'o', 1024 ) . ';inline',
                                        'content-duration' => 35.6363,
                                        'content-custom' => 'hello',
                                        'x-content-custom' => 'hello'
index 679382b..3f08fd2 100644 (file)
@@ -71,7 +71,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase {
                        }
                }
 
-               rmdir( $directory );
+               rmdir( $directory );
        }
 
        protected function tearDown() {
index 30d04d9..5e0fe89 100644 (file)
@@ -154,30 +154,30 @@ class BaseDumpTest extends MediaWikiTestCase {
                // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
                $header = '<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en">
   <siteinfo>
-       <sitename>wikisvn</sitename>
-       <base>http://localhost/wiki-svn/index.php/Main_Page</base>
-       <generator>MediaWiki 1.21alpha</generator>
-       <case>first-letter</case>
-       <namespaces>
-         <namespace key="-2" case="first-letter">Media</namespace>
-         <namespace key="-1" case="first-letter">Special</namespace>
-         <namespace key="0" case="first-letter" />
-         <namespace key="1" case="first-letter">Talk</namespace>
-         <namespace key="2" case="first-letter">User</namespace>
-         <namespace key="3" case="first-letter">User talk</namespace>
-         <namespace key="4" case="first-letter">Wikisvn</namespace>
-         <namespace key="5" case="first-letter">Wikisvn talk</namespace>
-         <namespace key="6" case="first-letter">File</namespace>
-         <namespace key="7" case="first-letter">File talk</namespace>
-         <namespace key="8" case="first-letter">MediaWiki</namespace>
-         <namespace key="9" case="first-letter">MediaWiki talk</namespace>
-         <namespace key="10" case="first-letter">Template</namespace>
-         <namespace key="11" case="first-letter">Template talk</namespace>
-         <namespace key="12" case="first-letter">Help</namespace>
-         <namespace key="13" case="first-letter">Help talk</namespace>
-         <namespace key="14" case="first-letter">Category</namespace>
-         <namespace key="15" case="first-letter">Category talk</namespace>
-       </namespaces>
+    <sitename>wikisvn</sitename>
+    <base>http://localhost/wiki-svn/index.php/Main_Page</base>
+    <generator>MediaWiki 1.21alpha</generator>
+    <case>first-letter</case>
+    <namespaces>
+      <namespace key="-2" case="first-letter">Media</namespace>
+      <namespace key="-1" case="first-letter">Special</namespace>
+      <namespace key="0" case="first-letter" />
+      <namespace key="1" case="first-letter">Talk</namespace>
+      <namespace key="2" case="first-letter">User</namespace>
+      <namespace key="3" case="first-letter">User talk</namespace>
+      <namespace key="4" case="first-letter">Wikisvn</namespace>
+      <namespace key="5" case="first-letter">Wikisvn talk</namespace>
+      <namespace key="6" case="first-letter">File</namespace>
+      <namespace key="7" case="first-letter">File talk</namespace>
+      <namespace key="8" case="first-letter">MediaWiki</namespace>
+      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
+      <namespace key="10" case="first-letter">Template</namespace>
+      <namespace key="11" case="first-letter">Template talk</namespace>
+      <namespace key="12" case="first-letter">Help</namespace>
+      <namespace key="13" case="first-letter">Help talk</namespace>
+      <namespace key="14" case="first-letter">Category</namespace>
+      <namespace key="15" case="first-letter">Category talk</namespace>
+    </namespaces>
   </siteinfo>
 ';
                // @codingStandardsIgnoreEnd
@@ -187,72 +187,72 @@ class BaseDumpTest extends MediaWikiTestCase {
 
                // Simple plain page
                $available_pages[1] = '  <page>
-       <title>BackupDumperTestP1</title>
-       <ns>0</ns>
-       <id>1</id>
-       <revision>
-         <id>1</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP1Summary1</comment>
-         <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
-         <text xml:space="preserve">BackupDumperTestP1Text1</text>
-         <model name="wikitext">1</model>
-         <format mime="text/x-wiki">1</format>
-       </revision>
+    <title>BackupDumperTestP1</title>
+    <ns>0</ns>
+    <id>1</id>
+    <revision>
+      <id>1</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP1Summary1</comment>
+      <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
+      <text xml:space="preserve">BackupDumperTestP1Text1</text>
+      <model name="wikitext">1</model>
+      <format mime="text/x-wiki">1</format>
+    </revision>
   </page>
 ';
                // Page with more than one revisions. Hole in rev ids.
                $available_pages[2] = '  <page>
-       <title>BackupDumperTestP2</title>
-       <ns>0</ns>
-       <id>2</id>
-       <revision>
-         <id>2</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary1</comment>
-         <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
-         <text xml:space="preserve">BackupDumperTestP2Text1</text>
-         <model name="wikitext">1</model>
-         <format mime="text/x-wiki">1</format>
-       </revision>
-       <revision>
-         <id>5</id>
-         <parentid>2</parentid>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary4 extra</comment>
-         <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
-         <text xml:space="preserve">BackupDumperTestP2Text4 some additional Text</text>
-         <model name="wikitext">1</model>
-         <format mime="text/x-wiki">1</format>
-       </revision>
+    <title>BackupDumperTestP2</title>
+    <ns>0</ns>
+    <id>2</id>
+    <revision>
+      <id>2</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary1</comment>
+      <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
+      <text xml:space="preserve">BackupDumperTestP2Text1</text>
+      <model name="wikitext">1</model>
+      <format mime="text/x-wiki">1</format>
+    </revision>
+    <revision>
+      <id>5</id>
+      <parentid>2</parentid>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary4 extra</comment>
+      <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
+      <text xml:space="preserve">BackupDumperTestP2Text4 some additional Text</text>
+      <model name="wikitext">1</model>
+      <format mime="text/x-wiki">1</format>
+    </revision>
   </page>
 ';
                // Page with id higher than previous id + 1
                $available_pages[4] = '  <page>
-       <title>Talk:BackupDumperTestP1</title>
-       <ns>1</ns>
-       <id>4</id>
-       <revision>
-         <id>8</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>Talk BackupDumperTestP1 Summary1</comment>
-         <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
-         <model name="wikitext">1</model>
-         <format mime="text/x-wiki">1</format>
-         <text xml:space="preserve">Talk about BackupDumperTestP1 Text1</text>
-       </revision>
+    <title>Talk:BackupDumperTestP1</title>
+    <ns>1</ns>
+    <id>4</id>
+    <revision>
+      <id>8</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>Talk BackupDumperTestP1 Summary1</comment>
+      <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
+      <model name="wikitext">1</model>
+      <format mime="text/x-wiki">1</format>
+      <text xml:space="preserve">Talk about BackupDumperTestP1 Text1</text>
+    </revision>
   </page>
 ';
 
index 95ba77c..c216864 100644 (file)
@@ -469,30 +469,30 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                        . 'xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ '
                        . 'http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
   <siteinfo>
-       <sitename>wikisvn</sitename>
-       <base>http://localhost/wiki-svn/index.php/Main_Page</base>
-       <generator>MediaWiki 1.21alpha</generator>
-       <case>first-letter</case>
-       <namespaces>
-         <namespace key="-2" case="first-letter">Media</namespace>
-         <namespace key="-1" case="first-letter">Special</namespace>
-         <namespace key="0" case="first-letter" />
-         <namespace key="1" case="first-letter">Talk</namespace>
-         <namespace key="2" case="first-letter">User</namespace>
-         <namespace key="3" case="first-letter">User talk</namespace>
-         <namespace key="4" case="first-letter">Wikisvn</namespace>
-         <namespace key="5" case="first-letter">Wikisvn talk</namespace>
-         <namespace key="6" case="first-letter">File</namespace>
-         <namespace key="7" case="first-letter">File talk</namespace>
-         <namespace key="8" case="first-letter">MediaWiki</namespace>
-         <namespace key="9" case="first-letter">MediaWiki talk</namespace>
-         <namespace key="10" case="first-letter">Template</namespace>
-         <namespace key="11" case="first-letter">Template talk</namespace>
-         <namespace key="12" case="first-letter">Help</namespace>
-         <namespace key="13" case="first-letter">Help talk</namespace>
-         <namespace key="14" case="first-letter">Category</namespace>
-         <namespace key="15" case="first-letter">Category talk</namespace>
-       </namespaces>
+    <sitename>wikisvn</sitename>
+    <base>http://localhost/wiki-svn/index.php/Main_Page</base>
+    <generator>MediaWiki 1.21alpha</generator>
+    <case>first-letter</case>
+    <namespaces>
+      <namespace key="-2" case="first-letter">Media</namespace>
+      <namespace key="-1" case="first-letter">Special</namespace>
+      <namespace key="0" case="first-letter" />
+      <namespace key="1" case="first-letter">Talk</namespace>
+      <namespace key="2" case="first-letter">User</namespace>
+      <namespace key="3" case="first-letter">User talk</namespace>
+      <namespace key="4" case="first-letter">Wikisvn</namespace>
+      <namespace key="5" case="first-letter">Wikisvn talk</namespace>
+      <namespace key="6" case="first-letter">File</namespace>
+      <namespace key="7" case="first-letter">File talk</namespace>
+      <namespace key="8" case="first-letter">MediaWiki</namespace>
+      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
+      <namespace key="10" case="first-letter">Template</namespace>
+      <namespace key="11" case="first-letter">Template talk</namespace>
+      <namespace key="12" case="first-letter">Help</namespace>
+      <namespace key="13" case="first-letter">Help talk</namespace>
+      <namespace key="14" case="first-letter">Category</namespace>
+      <namespace key="15" case="first-letter">Category talk</namespace>
+    </namespaces>
   </siteinfo>
 ';
                $tail = '</mediawiki>
@@ -503,98 +503,98 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                for ( $i = 0; $i < $iterations; $i++ ) {
 
                        $page1 = '  <page>
-       <title>BackupDumperTestP1</title>
-       <ns>0</ns>
-       <id>' . ( $this->pageId1 + $i * self::$numOfPages ) . '</id>
-       <revision>
-         <id>' . ( $this->revId1_1 + $i * self::$numOfRevs ) . '</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP1Summary1</comment>
-         <model>wikitext</model>
-         <format>text/x-wiki</format>
-         <text id="' . $this->textId1_1 . '" bytes="23" />
-         <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
-       </revision>
+    <title>BackupDumperTestP1</title>
+    <ns>0</ns>
+    <id>' . ( $this->pageId1 + $i * self::$numOfPages ) . '</id>
+    <revision>
+      <id>' . ( $this->revId1_1 + $i * self::$numOfRevs ) . '</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP1Summary1</comment>
+      <model>wikitext</model>
+      <format>text/x-wiki</format>
+      <text id="' . $this->textId1_1 . '" bytes="23" />
+      <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
+    </revision>
   </page>
 ';
                        $page2 = '  <page>
-       <title>BackupDumperTestP2</title>
-       <ns>0</ns>
-       <id>' . ( $this->pageId2 + $i * self::$numOfPages ) . '</id>
-       <revision>
-         <id>' . ( $this->revId2_1 + $i * self::$numOfRevs ) . '</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary1</comment>
-         <model>wikitext</model>
-         <format>text/x-wiki</format>
-         <text id="' . $this->textId2_1 . '" bytes="23" />
-         <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
-       </revision>
-       <revision>
-         <id>' . ( $this->revId2_2 + $i * self::$numOfRevs ) . '</id>
-         <parentid>' . ( $this->revId2_1 + $i * self::$numOfRevs ) . '</parentid>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary2</comment>
-         <model>wikitext</model>
-         <format>text/x-wiki</format>
-         <text id="' . $this->textId2_2 . '" bytes="23" />
-         <sha1>b7vj5ks32po5m1z1t1br4o7scdwwy95</sha1>
-       </revision>
-       <revision>
-         <id>' . ( $this->revId2_3 + $i * self::$numOfRevs ) . '</id>
-         <parentid>' . ( $this->revId2_2 + $i * self::$numOfRevs ) . '</parentid>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary3</comment>
-         <model>wikitext</model>
-         <format>text/x-wiki</format>
-         <text id="' . $this->textId2_3 . '" bytes="23" />
-         <sha1>jfunqmh1ssfb8rs43r19w98k28gg56r</sha1>
-       </revision>
-       <revision>
-         <id>' . ( $this->revId2_4 + $i * self::$numOfRevs ) . '</id>
-         <parentid>' . ( $this->revId2_3 + $i * self::$numOfRevs ) . '</parentid>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>BackupDumperTestP2Summary4 extra</comment>
-         <model>wikitext</model>
-         <format>text/x-wiki</format>
-         <text id="' . $this->textId2_4 . '" bytes="44" />
-         <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
-       </revision>
+    <title>BackupDumperTestP2</title>
+    <ns>0</ns>
+    <id>' . ( $this->pageId2 + $i * self::$numOfPages ) . '</id>
+    <revision>
+      <id>' . ( $this->revId2_1 + $i * self::$numOfRevs ) . '</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary1</comment>
+      <model>wikitext</model>
+      <format>text/x-wiki</format>
+      <text id="' . $this->textId2_1 . '" bytes="23" />
+      <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
+    </revision>
+    <revision>
+      <id>' . ( $this->revId2_2 + $i * self::$numOfRevs ) . '</id>
+      <parentid>' . ( $this->revId2_1 + $i * self::$numOfRevs ) . '</parentid>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary2</comment>
+      <model>wikitext</model>
+      <format>text/x-wiki</format>
+      <text id="' . $this->textId2_2 . '" bytes="23" />
+      <sha1>b7vj5ks32po5m1z1t1br4o7scdwwy95</sha1>
+    </revision>
+    <revision>
+      <id>' . ( $this->revId2_3 + $i * self::$numOfRevs ) . '</id>
+      <parentid>' . ( $this->revId2_2 + $i * self::$numOfRevs ) . '</parentid>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary3</comment>
+      <model>wikitext</model>
+      <format>text/x-wiki</format>
+      <text id="' . $this->textId2_3 . '" bytes="23" />
+      <sha1>jfunqmh1ssfb8rs43r19w98k28gg56r</sha1>
+    </revision>
+    <revision>
+      <id>' . ( $this->revId2_4 + $i * self::$numOfRevs ) . '</id>
+      <parentid>' . ( $this->revId2_3 + $i * self::$numOfRevs ) . '</parentid>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>BackupDumperTestP2Summary4 extra</comment>
+      <model>wikitext</model>
+      <format>text/x-wiki</format>
+      <text id="' . $this->textId2_4 . '" bytes="44" />
+      <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
+    </revision>
   </page>
 ';
                        // page 3 not in stub
 
                        $page4 = '  <page>
-       <title>Talk:BackupDumperTestP1</title>
-       <ns>1</ns>
-       <id>' . ( $this->pageId4 + $i * self::$numOfPages ) . '</id>
-       <revision>
-         <id>' . ( $this->revId4_1 + $i * self::$numOfRevs ) . '</id>
-         <timestamp>2012-04-01T16:46:05Z</timestamp>
-         <contributor>
-               <ip>127.0.0.1</ip>
-         </contributor>
-         <comment>Talk BackupDumperTestP1 Summary1</comment>
-         <model>BackupTextPassTestModel</model>
-         <format>text/plain</format>
-         <text id="' . $this->textId4_1 . '" bytes="35" />
-         <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
-       </revision>
+    <title>Talk:BackupDumperTestP1</title>
+    <ns>1</ns>
+    <id>' . ( $this->pageId4 + $i * self::$numOfPages ) . '</id>
+    <revision>
+      <id>' . ( $this->revId4_1 + $i * self::$numOfRevs ) . '</id>
+      <timestamp>2012-04-01T16:46:05Z</timestamp>
+      <contributor>
+        <ip>127.0.0.1</ip>
+      </contributor>
+      <comment>Talk BackupDumperTestP1 Summary1</comment>
+      <model>BackupTextPassTestModel</model>
+      <format>text/plain</format>
+      <text id="' . $this->textId4_1 . '" bytes="35" />
+      <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
+    </revision>
   </page>
 ';
                        $content .= $page1 . $page2 . $page4;
index 399290c..c71111f 100644 (file)
@@ -99,7 +99,7 @@
                                word: 'Wikipedia',
                                grammarForm: 'תחילית',
                                expected: '־Wikipedia',
-                               description: 'GAdd a hyphen (maqaf) before non-Hebrew letters'
+                               description: 'Add a hyphen (maqaf) before non-Hebrew letters'
                        },
                        {
                                word: '1995',
index d39d43b..738fa38 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -250,11 +250,16 @@ function wfStreamThumb( array $params ) {
        try {
                $thumbName = $img->thumbName( $params );
                if ( !strlen( $thumbName ) ) { // invalid params?
-                       throw new MediaTransformInvalidParametersException( 'Empty return from File::thumbName' );
+                       throw new MediaTransformInvalidParametersException(
+                               'Empty return from File::thumbName'
+                       );
                }
                $thumbName2 = $img->thumbName( $params, File::THUMB_FULL_NAME ); // b/c; "long" style
        } catch ( MediaTransformInvalidParametersException $e ) {
-               wfThumbError( 400, 'The specified thumbnail parameters are not valid: ' . $e->getMessage() );
+               wfThumbError(
+                       400,
+                       'The specified thumbnail parameters are not valid: ' . $e->getMessage()
+               );
                return;
        } catch ( MWException $e ) {
                wfThumbError( 500, $e->getHTML() );
@@ -294,7 +299,8 @@ function wfStreamThumb( array $params ) {
        $dispositionType = isset( $params['download'] ) ? 'attachment' : 'inline';
 
        // Suggest a good name for users downloading this thumbnail
-       $headers[] = "Content-Disposition: {$img->getThumbDisposition( $thumbName, $dispositionType )}";
+       $headers[] =
+               "Content-Disposition: {$img->getThumbDisposition( $thumbName, $dispositionType )}";
 
        if ( count( $varyHeader ) ) {
                $headers[] = 'Vary: ' . implode( ', ', $varyHeader );
@@ -333,7 +339,9 @@ function wfStreamThumb( array $params ) {
        $errorCode = 500;
        if ( !$thumb ) {
                $errorMsg = $errorMsg ?: $msg->rawParams( 'File::transform() returned false' )->escaped();
-               if ( $errorMsg instanceof MessageSpecifier && $errorMsg->getKey() === 'thumbnail_image-failure-limit' ) {
+               if ( $errorMsg instanceof MessageSpecifier &&
+                       $errorMsg->getKey() === 'thumbnail_image-failure-limit'
+               ) {
                        $errorCode = 429;
                }
        } elseif ( $thumb->isError() ) {
@@ -341,8 +349,9 @@ function wfStreamThumb( array $params ) {
        } elseif ( !$thumb->hasFile() ) {
                $errorMsg = $msg->rawParams( 'No path supplied in thumbnail object' )->escaped();
        } elseif ( $thumb->fileIsSource() ) {
-               $errorMsg = $msg->
-                       rawParams( 'Image was not scaled, is the requested width bigger than the source?' )->escaped();
+               $errorMsg = $msg
+                       ->rawParams( 'Image was not scaled, is the requested width bigger than the source?' )
+                       ->escaped();
                $errorCode = 400;
        }
 
@@ -585,7 +594,9 @@ function wfThumbError( $status, $msgHtml ) {
        }
        if ( $wgShowHostnames ) {
                header( 'X-MW-Thumbnail-Renderer: ' . wfHostname() );
-               $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
+               $url = htmlspecialchars(
+                       isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : ''
+               );
                $hostname = htmlspecialchars( wfHostname() );
                $debug = "<!-- $url -->\n<!-- $hostname -->\n";
        } else {