Update formatting
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Wed, 5 Feb 2014 11:02:29 +0000 (12:02 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Thu, 6 Feb 2014 08:27:05 +0000 (09:27 +0100)
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1

46 files changed:
includes/actions/RawAction.php
includes/api/ApiBase.php
includes/api/ApiPageSet.php
includes/api/ApiProtect.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryContributors.php
includes/api/ApiQueryFileRepoInfo.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiRevisionDelete.php
includes/api/ApiWatch.php
includes/cache/LocalisationCache.php
includes/changes/ChangesList.php
includes/changes/OldChangesList.php
includes/changes/RCCacheEntry.php
includes/config/Config.php
includes/config/GlobalConfig.php
includes/content/WikitextContent.php
includes/context/RequestContext.php
includes/db/Database.php
includes/db/DatabaseMysqli.php
includes/deferred/LinksUpdate.php
includes/diff/DifferenceEngine.php
includes/filebackend/FSFile.php
includes/filebackend/FileBackend.php
includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/FileBackendStore.php
includes/filebackend/FileOpBatch.php
includes/filebackend/MemoryFileBackend.php
includes/filebackend/SwiftFileBackend.php
includes/filebackend/lockmanager/QuorumLockManager.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/RepoGroup.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/filerepo/file/UnregisteredLocalFile.php
includes/gallery/ImageGalleryBase.php
includes/htmlform/HTMLFormField.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/installer/OracleUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
includes/installer/WebInstallerPage.php

index bab2f93..b753407 100644 (file)
@@ -165,7 +165,7 @@ class RawAction extends FormlessAction {
                                } elseif ( !$content instanceof TextContent ) {
                                        // non-text content
                                        wfHttpError( 415, "Unsupported Media Type", "The requested page uses the content model `"
-                                                                               . $content->getModel() . "` which is not supported via this interface." );
+                                               . $content->getModel() . "` which is not supported via this interface." );
                                        die();
                                } else {
                                        // want a section?
index 900c7be..72b1f88 100644 (file)
@@ -1406,6 +1406,7 @@ abstract class ApiBase extends ContextSource {
                        // Translate message to code, for backwards compatability
                        $code = ApiBase::$messageMap[$code]['code'];
                }
+
                return array( $code, $msg->inLanguage( 'en' )->useDatabase( false )->plain() );
        }
 
index 4ecf029..c712539 100644 (file)
@@ -546,7 +546,7 @@ class ApiPageSet extends ApiBase {
                        self::addValues( $result, $this->getSpecialTitles(), 'special', 'title' );
                }
                if ( in_array( "missingIds", $invalidChecks ) ) {
-               self::addValues( $result, $this->getMissingPageIDs(), 'missing', 'pageid' );
+                       self::addValues( $result, $this->getMissingPageIDs(), 'missing', 'pageid' );
                }
                if ( in_array( "missingRevIds", $invalidChecks ) ) {
                        self::addValues( $result, $this->getMissingRevisionIDs(), 'missing', 'revid' );
@@ -557,6 +557,7 @@ class ApiPageSet extends ApiBase {
                if ( in_array( "interwikiTitles", $invalidChecks ) ) {
                        self::addValues( $result, $this->getInterwikiTitlesAsResult() );
                }
+
                return $result;
        }
 
index 80c76b3..644e97e 100644 (file)
@@ -92,10 +92,13 @@ class ApiProtect extends ApiBase {
                                }
                                $expiryarray[$p[0]] = $exp;
                        }
-                       $resultProtections[] = array( $p[0] => $protections[$p[0]],
-                               'expiry' => ( $expiryarray[$p[0]] == $db->getInfinity() ?
-                                       'infinite' :
-                                       wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] ) ) );
+                       $resultProtections[] = array(
+                               $p[0] => $protections[$p[0]],
+                               'expiry' => ( $expiryarray[$p[0]] == $db->getInfinity()
+                                       ? 'infinite'
+                                       : wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] )
+                               )
+                       );
                }
 
                $cascade = $params['cascade'];
index eb51095..9d9f7c3 100644 (file)
@@ -501,6 +501,7 @@ abstract class ApiQueryBase extends ApiBase {
                        // prefix.
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
+
                return substr( $t->getDbKey(), 0, -1 );
        }
 
index 6b896e3..37fb489 100644 (file)
@@ -98,6 +98,7 @@ class ApiQueryContributors extends ApiQueryBase {
                                $this->setContinueEnumParameter( 'continue',
                                        $params['continue'] !== null ? $params['continue'] : '0|0'
                                );
+
                                return;
                        }
                }
@@ -144,6 +145,7 @@ class ApiQueryContributors extends ApiQueryBase {
                                        // of anoncontributors
                                        $this->setContinueEnumParameter( 'continue', $continuePages );
                                }
+
                                return;
                        }
                } elseif ( $params['excluderights'] ) {
@@ -182,6 +184,7 @@ class ApiQueryContributors extends ApiQueryBase {
                                // We've reached the one extra which shows that
                                // there are additional pages to be had. Stop here...
                                $this->setContinueEnumParameter( 'continue', $row->page . '|' . $row->user );
+
                                return;
                        }
 
@@ -191,6 +194,7 @@ class ApiQueryContributors extends ApiQueryBase {
                        );
                        if ( !$fit ) {
                                $this->setContinueEnumParameter( 'continue', $row->page . '|' . $row->user );
+
                                return;
                        }
                }
@@ -269,7 +273,6 @@ class ApiQueryContributors extends ApiQueryBase {
                );
        }
 
-
        public function getDescription() {
                return 'Get the list of logged-in contributors and ' .
                        'the count of anonymous contributors to a page';
index dffe301..d9579a1 100644 (file)
@@ -36,6 +36,7 @@ class ApiQueryFileRepoInfo extends ApiQueryBase {
        protected function getInitialisedRepoGroup() {
                $repoGroup = RepoGroup::singleton();
                $repoGroup->initialiseRepos();
+
                return $repoGroup;
        }
 
index a9a5f5f..9cf3afd 100644 (file)
@@ -562,7 +562,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                        $vcsVersion = $gitInfo->getHeadSHA1();
                                        if ( $vcsVersion !== false ) {
                                                $ret['vcs-system'] = 'git';
-                                               $ret['vcs-version'] =  $vcsVersion;
+                                               $ret['vcs-version'] = $vcsVersion;
                                                $ret['vcs-url'] = $gitInfo->getHeadViewUrl();
                                                $ret['vcs-date'] = wfTimestamp( TS_ISO_8601, $gitInfo->getHeadCommitDate() );
                                        } else {
index 9ba30d7..05457b3 100644 (file)
@@ -129,6 +129,7 @@ class ApiRevisionDelete extends ApiBase {
                        $this->getResult()->setIndexedTagName( $warnings, 'w' );
                        $ret['warnings'] = $warnings;
                }
+
                return $ret;
        }
 
@@ -159,6 +160,7 @@ class ApiRevisionDelete extends ApiBase {
                        $message['rendered'] = $msg->useDatabase( false )->inLanguage( 'en' )->plain();
                        $ret[] = $message;
                }
+
                return $ret;
        }
 
index d0049ff..100ee96 100644 (file)
@@ -134,12 +134,12 @@ class ApiWatch extends ApiBase {
                        if ( $compatibilityMode ) {
                                $this->dieStatus( $status );
                        }
-                       $res['error'] =  $this->getErrorFromStatus( $status );
+                       $res['error'] = $this->getErrorFromStatus( $status );
                }
+
                return $res;
        }
 
-
        /**
         * Get a cached instance of an ApiPageSet object
         * @return ApiPageSet
@@ -148,6 +148,7 @@ class ApiWatch extends ApiBase {
                if ( $this->mPageSet === null ) {
                        $this->mPageSet = new ApiPageSet( $this );
                }
+
                return $this->mPageSet;
        }
 
@@ -183,11 +184,13 @@ class ApiWatch extends ApiBase {
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
                }
+
                return $result;
        }
 
        public function getParamDescription() {
                $psModule = $this->getPageSet();
+
                return $psModule->getParamDescription() + array(
                        'title' => 'The page to (un)watch. use titles instead',
                        'unwatch' => 'If set the page will be unwatched rather than watched',
index 915a43e..409160c 100644 (file)
@@ -559,6 +559,7 @@ class LocalisationCache {
                                unset( $data[$key] );
                        }
                }
+
                // The JSON format only supports messages, none of the other variables, so wrap the data
                return array( 'messages' => $data );
        }
index 470b150..b996894 100644 (file)
@@ -248,6 +248,7 @@ class ChangesList extends ContextSource {
        public function endRecentChangesList() {
                $out = $this->rclistOpen ? "</ul>\n" : '';
                $out .= '</div>';
+
                return $out;
        }
 
index 56630a6..9cb1146 100644 (file)
@@ -19,6 +19,7 @@
  *
  * @file
  */
+
 class OldChangesList extends ChangesList {
        /**
         * Format a line using the old system (aka without any javascript).
index 271dd4a..07a9409 100644 (file)
@@ -17,6 +17,7 @@
  *
  * @file
  */
+
 class RCCacheEntry extends RecentChange {
        public $curlink;
        public $difflink;
index 067b1e4..04afdda 100644 (file)
@@ -25,9 +25,7 @@
  *
  * @since 1.23
  */
-
 abstract class Config {
-
        /**
         * @param string $name configuration variable name without prefix
         * @param string $prefix of the variable name
index 1b1cd89..e16a9ee 100644 (file)
@@ -39,6 +39,7 @@ class GlobalConfig extends Config {
         */
        public function set( $name, $value, $prefix = 'wg' ) {
                $GLOBALS[$prefix . $name] = $value;
+
                return Status::newGood();
        }
 }
index a92699b..f495c56 100644 (file)
@@ -202,6 +202,7 @@ class WikitextContent extends TextContent {
         */
        public function getRedirectTarget() {
                list( $title, ) = $this->getRedirectTargetAndText();
+
                return $title;
        }
 
index 978ef03..aabdd9d 100644 (file)
@@ -86,6 +86,7 @@ class RequestContext implements IContextSource {
                if ( $this->config === null ) {
                        $this->config = Config::factory();
                }
+
                return $this->config;
        }
 
index f94d586..c6f2611 100644 (file)
@@ -2758,7 +2758,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
         * @param string $delTable The table to delete from.
         * @param string $joinTable The other table.
         * @param string $delVar The variable to join on, in the first table.
-        * @param string$joinVar The variable to join on, in the second table.
+        * @param string $joinVar The variable to join on, in the second table.
         * @param array $conds Condition array of field names mapped to variables,
         *   ANDed together in the WHERE clause
         * @param string $fname Calling function name (use __METHOD__) for logs/profiling
index d41f3e4..e202f8a 100644 (file)
@@ -244,6 +244,7 @@ class DatabaseMysqli extends DatabaseMysqlBase {
         */
        protected function mysqlFieldType( $res, $n ) {
                $field = $res->fetch_field_direct( $n );
+
                return $field->type;
        }
 
index 01555ff..79232e5 100644 (file)
@@ -256,7 +256,7 @@ class LinksUpdate extends SqlDataUpdate {
                        $job = new RefreshLinksJob(
                                $title,
                                array(
-                                       'table'     => $table,
+                                       'table' => $table,
                                        'recursive' => true,
                                ) + Job::newRootJobParams( // "overall" refresh links job info
                                        "refreshlinks:{$table}:{$title->getPrefixedText()}"
index 47135a3..d6cf694 100644 (file)
@@ -88,7 +88,7 @@ class DifferenceEngine extends ContextSource {
         */
        protected $mReducedLineNumbers = false;
 
-       /** @var string Link to action=markpatrolled  */
+       /** @var string Link to action=markpatrolled */
        protected $mMarkPatrolledLink = null;
 
        /** @var bool Show rev_deleted content if allowed */
@@ -965,7 +965,8 @@ class DifferenceEngine extends ContextSource {
                        $limit = 100; // use diff-multi-manyusers if too many users
                        $users = $this->mNewPage->getAuthorsBetween( $oldRev, $newRev, $limit );
                        $numUsers = count( $users );
-                       if( $numUsers == 1 && $users[0] == $newRev->getRawUserText() ) {
+
+                       if ( $numUsers == 1 && $users[0] == $newRev->getRawUserText() ) {
                                $numUsers = 0; // special case to say "by the same user" instead of "by one other user"
                        }
 
index 047aefd..34f6b51 100644 (file)
@@ -30,7 +30,7 @@ class FSFile {
        /** @var string Path to file */
        protected $path;
 
-       /** @var string File SHA-1 in base 36  */
+       /** @var string File SHA-1 in base 36 */
        protected $sha1Base36;
 
        /**
index f5d63b9..00a4d5e 100644 (file)
@@ -105,7 +105,7 @@ abstract class FileBackend {
        protected $fileJournal;
 
        /** Flags for supported features */
-       const ATTR_HEADERS  = 1;
+       const ATTR_HEADERS = 1;
        const ATTR_METADATA = 2;
 
        /**
index 1b2860a..81d088e 100644 (file)
@@ -45,7 +45,7 @@ class FileBackendMultiWrite extends FileBackend {
         */
        protected $backends = array();
 
-       /** @var int Index of master backend  */
+       /** @var int Index of master backend */
        protected $masterIndex = -1;
 
        /** @var int Bitfield */
@@ -569,6 +569,7 @@ class FileBackendMultiWrite extends FileBackend {
 
        public function getFileXAttributes( array $params ) {
                $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
+
                return $this->backends[$this->masterIndex]->getFileXAttributes( $realParams );
        }
 
index 13f6436..50371f8 100644 (file)
@@ -724,6 +724,7 @@ abstract class FileBackendStore extends FileBackend {
                wfProfileOut( __METHOD__ . '-miss-' . $this->name );
                wfProfileOut( __METHOD__ . '-miss' );
                $this->cheapCache->set( $path, 'xattr', array( 'map' => $fields, 'latest' => $latest ) );
+
                return $fields;
        }
 
@@ -1681,12 +1682,15 @@ abstract class FileBackendStore extends FileBackend {
         */
        final protected static function normalizeXAttributes( array $xattr ) {
                $newXAttr = array( 'headers' => array(), 'metadata' => array() );
+
                foreach ( $xattr['headers'] as $name => $value ) {
                        $newXAttr['headers'][strtolower( $name )] = $value;
                }
+
                foreach ( $xattr['metadata'] as $name => $value ) {
                        $newXAttr['metadata'][strtolower( $name )] = $value;
                }
+
                return $newXAttr;
        }
 
index b42e140..e90fcb7 100644 (file)
@@ -61,6 +61,7 @@ class FileOpBatch {
                $n = count( $performOps );
                if ( $n > self::MAX_BATCH_SIZE ) {
                        $status->fatal( 'backend-fail-batchsize', $n, self::MAX_BATCH_SIZE );
+
                        return $status;
                }
 
index 6f40957..7c2f825 100644 (file)
@@ -45,11 +45,12 @@ class MemoryFileBackend extends FileBackendStore {
                $dst = $this->resolveHashKey( $params['dst'] );
                if ( $dst === null ) {
                        $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
+
                        return $status;
                }
 
                $this->files[$dst] = array(
-                       'data'  => $params['content'],
+                       'data' => $params['content'],
                        'mtime' => wfTimestamp( TS_MW, time() )
                );
 
@@ -62,6 +63,7 @@ class MemoryFileBackend extends FileBackendStore {
                $dst = $this->resolveHashKey( $params['dst'] );
                if ( $dst === null ) {
                        $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
+
                        return $status;
                }
 
@@ -70,11 +72,12 @@ class MemoryFileBackend extends FileBackendStore {
                wfRestoreWarnings();
                if ( $data === false ) { // source doesn't exist?
                        $status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
+
                        return $status;
                }
 
                $this->files[$dst] = array(
-                       'data'  => $data,
+                       'data' => $data,
                        'mtime' => wfTimestamp( TS_MW, time() )
                );
 
@@ -87,12 +90,14 @@ class MemoryFileBackend extends FileBackendStore {
                $src = $this->resolveHashKey( $params['src'] );
                if ( $src === null ) {
                        $status->fatal( 'backend-fail-invalidpath', $params['src'] );
+
                        return $status;
                }
 
                $dst = $this->resolveHashKey( $params['dst'] );
                if ( $dst === null ) {
                        $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
+
                        return $status;
                }
 
@@ -100,11 +105,12 @@ class MemoryFileBackend extends FileBackendStore {
                        if ( empty( $params['ignoreMissingSource'] ) ) {
                                $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
                        }
+
                        return $status;
                }
 
                $this->files[$dst] = array(
-                       'data'  => $this->files[$src]['data'],
+                       'data' => $this->files[$src]['data'],
                        'mtime' => wfTimestamp( TS_MW, time() )
                );
 
@@ -117,6 +123,7 @@ class MemoryFileBackend extends FileBackendStore {
                $src = $this->resolveHashKey( $params['src'] );
                if ( $src === null ) {
                        $status->fatal( 'backend-fail-invalidpath', $params['src'] );
+
                        return $status;
                }
 
@@ -124,6 +131,7 @@ class MemoryFileBackend extends FileBackendStore {
                        if ( empty( $params['ignoreMissingSource'] ) ) {
                                $status->fatal( 'backend-fail-delete', $params['src'] );
                        }
+
                        return $status;
                }
 
@@ -141,7 +149,7 @@ class MemoryFileBackend extends FileBackendStore {
                if ( isset( $this->files[$src] ) ) {
                        return array(
                                'mtime' => $this->files[$src]['mtime'],
-                               'size'  => strlen( $this->files[$src]['data'] ),
+                               'size' => strlen( $this->files[$src]['data'] ),
                        );
                }
 
@@ -167,6 +175,7 @@ class MemoryFileBackend extends FileBackendStore {
                        }
                        $tmpFiles[$srcPath] = $fsFile;
                }
+
                return $tmpFiles;
        }
 
@@ -176,6 +185,7 @@ class MemoryFileBackend extends FileBackendStore {
                $src = $this->resolveHashKey( $params['src'] );
                if ( $src === null || !isset( $this->files[$src] ) ) {
                        $status->fatal( 'backend-fail-stream', $params['src'] );
+
                        return $status;
                }
 
@@ -191,6 +201,7 @@ class MemoryFileBackend extends FileBackendStore {
                                return true;
                        }
                }
+
                return false;
        }
 
@@ -219,6 +230,7 @@ class MemoryFileBackend extends FileBackendStore {
                                }
                        }
                }
+
                return array_keys( $dirs );
        }
 
@@ -237,6 +249,7 @@ class MemoryFileBackend extends FileBackendStore {
                                $files[] = $relPath;
                        }
                }
+
                return $files;
        }
 
@@ -255,6 +268,7 @@ class MemoryFileBackend extends FileBackendStore {
                if ( $relPath === null ) {
                        return null; // invalid
                }
+
                return ( $relPath !== '' ) ? "$fullCont/$relPath" : $fullCont;
        }
 }
index c3d2de8..d524cc2 100644 (file)
@@ -176,7 +176,7 @@ class SwiftFileBackend extends FileBackendStore {
                $headers = array();
 
                // Normalize casing, and strip out illegal headers
-               if ( isset( $params['headers'] )  ) {
+               if ( isset( $params['headers'] ) ) {
                        foreach ( $params['headers'] as $name => $value ) {
                                $name = strtolower( $name );
                                if ( preg_match( '/^content-(type|length)$/', $name ) ) {
@@ -220,20 +220,20 @@ class SwiftFileBackend extends FileBackendStore {
                $contentType = $this->getContentType( $params['dst'], $params['content'], null );
 
                $reqs = array( array(
-                       'method'  => 'PUT',
-                       'url'     => array( $dstCont, $dstRel ),
+                       'method' => 'PUT',
+                       'url' => array( $dstCont, $dstRel ),
                        'headers' => array(
-                               'content-length'           => strlen( $params['content'] ),
-                               'etag'                     => md5( $params['content'] ),
-                               'content-type'             => $contentType,
+                               'content-length' => strlen( $params['content'] ),
+                               'etag' => md5( $params['content'] ),
+                               'content-type' => $contentType,
                                'x-object-meta-sha1base36' => $sha1Hash
                        ) + $this->sanitizeHdrs( $params ),
-                       'body'    => $params['content']
+                       'body' => $params['content']
                ) );
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $rcode === 201 ) {
                                // good
@@ -283,20 +283,20 @@ class SwiftFileBackend extends FileBackendStore {
                }
 
                $reqs = array( array(
-                       'method'  => 'PUT',
-                       'url'     => array( $dstCont, $dstRel ),
+                       'method' => 'PUT',
+                       'url' => array( $dstCont, $dstRel ),
                        'headers' => array(
-                               'content-length'           => filesize( $params['src'] ),
-                               'etag'                     => md5_file( $params['src'] ),
-                               'content-type'             => $contentType,
+                               'content-length' => filesize( $params['src'] ),
+                               'etag' => md5_file( $params['src'] ),
+                               'content-type' => $contentType,
                                'x-object-meta-sha1base36' => $sha1Hash
                        ) + $this->sanitizeHdrs( $params ),
-                       'body'    => $handle // resource
+                       'body' => $handle // resource
                ) );
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $rcode === 201 ) {
                                // good
@@ -335,8 +335,8 @@ class SwiftFileBackend extends FileBackendStore {
                }
 
                $reqs = array( array(
-                       'method'  => 'PUT',
-                       'url'     => array( $dstCont, $dstRel ),
+                       'method' => 'PUT',
+                       'url' => array( $dstCont, $dstRel ),
                        'headers' => array(
                                'x-copy-from' => '/' . rawurlencode( $srcCont ) .
                                        '/' . str_replace( "%2F", "/", rawurlencode( $srcRel ) )
@@ -345,7 +345,7 @@ class SwiftFileBackend extends FileBackendStore {
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $rcode === 201 ) {
                                // good
@@ -385,8 +385,8 @@ class SwiftFileBackend extends FileBackendStore {
 
                $reqs = array(
                        array(
-                               'method'  => 'PUT',
-                               'url'     => array( $dstCont, $dstRel ),
+                               'method' => 'PUT',
+                               'url' => array( $dstCont, $dstRel ),
                                'headers' => array(
                                        'x-copy-from' => '/' . rawurlencode( $srcCont ) .
                                                '/' . str_replace( "%2F", "/", rawurlencode( $srcRel ) )
@@ -395,15 +395,15 @@ class SwiftFileBackend extends FileBackendStore {
                );
                if ( "{$srcCont}/{$srcRel}" !== "{$dstCont}/{$dstRel}" ) {
                        $reqs[] = array(
-                               'method'  => 'DELETE',
-                               'url'     => array( $srcCont, $srcRel ),
+                               'method' => 'DELETE',
+                               'url' => array( $srcCont, $srcRel ),
                                'headers' => array()
                        );
                }
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $request['method'] === 'PUT' && $rcode === 201 ) {
                                // good
@@ -436,16 +436,15 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               $reqs = array(
-                       array(
-                               'method'  => 'DELETE',
-                               'url'     => array( $srcCont, $srcRel ),
-                               'headers' => array()
+               $reqs = array( array(
+                       'method' => 'DELETE',
+                       'url' => array( $srcCont, $srcRel ),
+                       'headers' => array()
                ) );
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $rcode === 204 ) {
                                // good
@@ -497,14 +496,14 @@ class SwiftFileBackend extends FileBackendStore {
                $customHdrs = $this->sanitizeHdrs( $params ) + $stat['xattr']['headers'];
 
                $reqs = array( array(
-                       'method'  => 'POST',
-                       'url'     => array( $srcCont, $srcRel ),
+                       'method' => 'POST',
+                       'url' => array( $srcCont, $srcRel ),
                        'headers' => $metaHdrs + $customHdrs
                ) );
 
                $be = $this;
                $method = __METHOD__;
-               $handler = function( array $request, Status $status ) use ( $be, $method, $params ) {
+               $handler = function ( array $request, Status $status ) use ( $be, $method, $params ) {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
                        if ( $rcode === 202 ) {
                                // good
@@ -534,6 +533,7 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status; // already there
                } elseif ( $stat === null ) {
                        $status->fatal( 'backend-fail-internal', $this->name );
+
                        return $status;
                }
 
@@ -603,6 +603,7 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status; // ok, nothing to do
                } elseif ( !is_array( $stat ) ) {
                        $status->fatal( 'backend-fail-internal', $this->name );
+
                        return $status;
                }
 
@@ -636,8 +637,8 @@ class SwiftFileBackend extends FileBackendStore {
 
                // (b) Check the file
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'HEAD',
-                       'url'     => $this->storageUrl( $auth, $srcCont, $srcRel ),
+                       'method' => 'HEAD',
+                       'url' => $this->storageUrl( $auth, $srcCont, $srcRel ),
                        'headers' => $this->authTokenHeaders( $auth ) + $this->headersFromParams( $params )
                ) );
                if ( $rcode === 200 || $rcode === 204 ) {
@@ -656,9 +657,9 @@ class SwiftFileBackend extends FileBackendStore {
                                // Convert various random Swift dates to TS_MW
                                'mtime' => $this->convertSwiftDate( $rhdrs['last-modified'], TS_MW ),
                                // Empty objects actually return no content-length header in Ceph
-                               'size'  => isset( $rhdrs['content-length'] ) ? (int)$rhdrs['content-length'] : 0,
-                               'sha1'  => $rhdrs[ 'x-object-meta-sha1base36'],
-                               'md5'   => ctype_xdigit( $rhdrs['etag'] ) ? $rhdrs['etag'] : null,
+                               'size' => isset( $rhdrs['content-length'] ) ? (int)$rhdrs['content-length'] : 0,
+                               'sha1' => $rhdrs['x-object-meta-sha1base36'],
+                               'md5' => ctype_xdigit( $rhdrs['etag'] ) ? $rhdrs['etag'] : null,
                                'xattr' => array( 'metadata' => $metadata, 'headers' => $headers )
                        );
                } elseif ( $rcode === 404 ) {
@@ -684,6 +685,7 @@ class SwiftFileBackend extends FileBackendStore {
        protected function convertSwiftDate( $ts, $format = TS_MW ) {
                try {
                        $timestamp = new MWTimestamp( $ts );
+
                        return $timestamp->getTimestamp( $format );
                } catch ( MWException $e ) {
                        throw new FileBackendError( $e->getMessage() );
@@ -708,6 +710,7 @@ class SwiftFileBackend extends FileBackendStore {
                $auth = $this->getAuthentication();
                if ( !$auth ) {
                        $objHdrs['x-object-meta-sha1base36'] = false;
+
                        return $objHdrs; // failed
                }
 
@@ -721,8 +724,8 @@ class SwiftFileBackend extends FileBackendStore {
                                        $objHdrs['x-object-meta-sha1base36'] = $hash;
                                        list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $path );
                                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                                               'method'  => 'POST',
-                                               'url'     => $this->storageUrl( $auth, $srcCont, $srcRel ),
+                                               'method' => 'POST',
+                                               'url' => $this->storageUrl( $auth, $srcCont, $srcRel ),
                                                'headers' => $this->authTokenHeaders( $auth ) + $objHdrs
                                        ) );
                                        if ( $rcode >= 200 && $rcode <= 299 ) {
@@ -759,11 +762,11 @@ class SwiftFileBackend extends FileBackendStore {
                                $handle = fopen( 'php://temp', 'wb' );
                                if ( $handle ) {
                                        $reqs[$path] = array(
-                                               'method'  => 'GET',
-                                               'url'     => $this->storageUrl( $auth, $srcCont, $srcRel ),
+                                               'method' => 'GET',
+                                               'url' => $this->storageUrl( $auth, $srcCont, $srcRel ),
                                                'headers' => $this->authTokenHeaders( $auth )
                                                        + $this->headersFromParams( $params ),
-                                               'stream'  => $handle,
+                                               'stream' => $handle,
                                        );
                                } else {
                                        $data = false;
@@ -796,6 +799,7 @@ class SwiftFileBackend extends FileBackendStore {
                if ( $status->isOk() ) {
                        return ( count( $status->value ) );
                }
+
                return null; // error
        }
 
@@ -853,20 +857,25 @@ class SwiftFileBackend extends FileBackendStore {
                                        $dirs[] = $object; // directories end in '/'
                                }
                        }
-               // Recursive: list all dirs under $dir and its subdirs
                } else {
-                       $getParentDir = function( $path ) {
+                       // Recursive: list all dirs under $dir and its subdirs
+                       $getParentDir = function ( $path ) {
                                return ( strpos( $path, '/' ) !== false ) ? dirname( $path ) : false;
                        };
+
                        // Get directory from last item of prior page
                        $lastDir = $getParentDir( $after ); // must be first page
                        $status = $this->objectListing( $fullCont, 'names', $limit, $after, $prefix );
+
                        if ( !$status->isOk() ) {
                                return $dirs; // error
                        }
+
                        $objects = $status->value;
+
                        foreach ( $objects as $object ) { // files
                                $objectDir = $getParentDir( $object ); // directory of object
+
                                if ( $objectDir !== false && $objectDir !== $dir ) {
                                        // Swift stores paths in UTF-8, using binary sorting.
                                        // See function "create_container_table" in common/db.py.
@@ -924,20 +933,23 @@ class SwiftFileBackend extends FileBackendStore {
                        } else {
                                $status = $this->objectListing( $fullCont, 'names', $limit, $after, $prefix, '/' );
                        }
-               // Recursive: list all files under $dir and its subdirs
                } else {
+                       // Recursive: list all files under $dir and its subdirs
                        if ( !empty( $params['adviseStat'] ) ) {
                                $status = $this->objectListing( $fullCont, 'info', $limit, $after, $prefix );
                        } else {
                                $status = $this->objectListing( $fullCont, 'names', $limit, $after, $prefix );
                        }
                }
+
                // Reformat this list into a list of (name, stat array or null) entries
                if ( !$status->isOk() ) {
                        return $files; // error
                }
+
                $objects = $status->value;
                $files = $this->buildFileObjectListing( $params, $dir, $objects );
+
                // Page on the unfiltered object listing (what is returned may be filtered)
                if ( count( $objects ) < $limit ) {
                        $after = INF; // avoid a second RTT
@@ -967,9 +979,9 @@ class SwiftFileBackend extends FileBackendStore {
                                }
                                $stat = array(
                                        // Convert various random Swift dates to TS_MW
-                                       'mtime'  => $this->convertSwiftDate( $object->last_modified, TS_MW ),
-                                       'size'   => (int)$object->bytes,
-                                       'md5'    => ctype_xdigit( $object->hash ) ? $object->hash : null,
+                                       'mtime' => $this->convertSwiftDate( $object->last_modified, TS_MW ),
+                                       'size' => (int)$object->bytes,
+                                       'md5' => ctype_xdigit( $object->hash ) ? $object->hash : null,
                                        'latest' => false // eventually consistent
                                );
                                $names[] = array( $object->name, $stat );
@@ -1000,6 +1012,7 @@ class SwiftFileBackend extends FileBackendStore {
                                $this->clearCache( array( $params['src'] ) );
                                $stat = $this->getFileStat( $params );
                        }
+
                        return $stat['xattr'];
                } else {
                        return false;
@@ -1032,17 +1045,18 @@ class SwiftFileBackend extends FileBackendStore {
                $auth = $this->getAuthentication();
                if ( !$auth || !is_array( $this->getContainerStat( $srcCont ) ) ) {
                        $status->fatal( 'backend-fail-stream', $params['src'] );
+
                        return $status;
                }
 
                $handle = fopen( 'php://output', 'wb' );
 
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'GET',
-                       'url'     => $this->storageUrl( $auth, $srcCont, $srcRel ),
+                       'method' => 'GET',
+                       'url' => $this->storageUrl( $auth, $srcCont, $srcRel ),
                        'headers' => $this->authTokenHeaders( $auth )
                                + $this->headersFromParams( $params ),
-                       'stream'  => $handle,
+                       'stream' => $handle,
                ) );
 
                if ( $rcode >= 200 && $rcode <= 299 ) {
@@ -1082,11 +1096,11 @@ class SwiftFileBackend extends FileBackendStore {
                                        $handle = fopen( $tmpFile->getPath(), 'wb' );
                                        if ( $handle ) {
                                                $reqs[$path] = array(
-                                                       'method'  => 'GET',
-                                                       'url'     => $this->storageUrl( $auth, $srcCont, $srcRel ),
+                                                       'method' => 'GET',
+                                                       'url' => $this->storageUrl( $auth, $srcCont, $srcRel ),
                                                        'headers' => $this->authTokenHeaders( $auth )
                                                                + $this->headersFromParams( $params ),
-                                                       'stream'  => $handle,
+                                                       'stream' => $handle,
                                                );
                                        } else {
                                                $tmpFile = null;
@@ -1142,6 +1156,7 @@ class SwiftFileBackend extends FileBackendStore {
                                        "GET\n{$expires}\n{$contPath}/{$srcRel}",
                                        $this->swiftTempUrlKey
                                );
+
                                return "{$url}?temp_url_sig={$signature}&temp_url_expires={$expires}";
                        } else { // give S3 API URL for rgw
                                // Path for signature starts with the bucket
@@ -1199,6 +1214,7 @@ class SwiftFileBackend extends FileBackendStore {
                        foreach ( $fileOpHandles as $index => $fileOpHandle ) {
                                $statuses[$index] = Status::newFatal( 'backend-fail-connect', $this->name );
                        }
+
                        return $statuses;
                }
 
@@ -1263,18 +1279,19 @@ class SwiftFileBackend extends FileBackendStore {
         */
        protected function setContainerAccess( $container, array $readGrps, array $writeGrps ) {
                $status = Status::newGood();
-
                $auth = $this->getAuthentication();
+
                if ( !$auth ) {
                        $status->fatal( 'backend-fail-connect', $this->name );
+
                        return $status;
                }
 
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'POST',
-                       'url'     => $this->storageUrl( $auth, $container ),
+                       'method' => 'POST',
+                       'url' => $this->storageUrl( $auth, $container ),
                        'headers' => $this->authTokenHeaders( $auth ) + array(
-                               'x-container-read'  => implode( ',', $readGrps ),
+                               'x-container-read' => implode( ',', $readGrps ),
                                'x-container-write' => implode( ',', $writeGrps )
                        )
                ) );
@@ -1307,8 +1324,8 @@ class SwiftFileBackend extends FileBackendStore {
                        }
 
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                               'method'  => 'HEAD',
-                               'url'     => $this->storageUrl( $auth, $container ),
+                               'method' => 'HEAD',
+                               'url' => $this->storageUrl( $auth, $container ),
                                'headers' => $this->authTokenHeaders( $auth )
                        ) );
 
@@ -1327,6 +1344,7 @@ class SwiftFileBackend extends FileBackendStore {
                        } else {
                                $this->onError( null, __METHOD__,
                                        array( 'cont' => $container ), $rerr, $rcode, $rdesc );
+
                                return null;
                        }
                }
@@ -1347,6 +1365,7 @@ class SwiftFileBackend extends FileBackendStore {
                $auth = $this->getAuthentication();
                if ( !$auth ) {
                        $status->fatal( 'backend-fail-connect', $this->name );
+
                        return $status;
                }
 
@@ -1359,10 +1378,10 @@ class SwiftFileBackend extends FileBackendStore {
                $writeGrps = array( $this->swiftUser ); // sanity
 
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'PUT',
-                       'url'     => $this->storageUrl( $auth, $container ),
+                       'method' => 'PUT',
+                       'url' => $this->storageUrl( $auth, $container ),
                        'headers' => $this->authTokenHeaders( $auth ) + array(
-                               'x-container-read'  => implode( ',', $readGrps ),
+                               'x-container-read' => implode( ',', $readGrps ),
                                'x-container-write' => implode( ',', $writeGrps )
                        )
                ) );
@@ -1391,12 +1410,13 @@ class SwiftFileBackend extends FileBackendStore {
                $auth = $this->getAuthentication();
                if ( !$auth ) {
                        $status->fatal( 'backend-fail-connect', $this->name );
+
                        return $status;
                }
 
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'DELETE',
-                       'url'     => $this->storageUrl( $auth, $container ),
+                       'method' => 'DELETE',
+                       'url' => $this->storageUrl( $auth, $container ),
                        'headers' => $this->authTokenHeaders( $auth )
                ) );
 
@@ -1433,6 +1453,7 @@ class SwiftFileBackend extends FileBackendStore {
                $auth = $this->getAuthentication();
                if ( !$auth ) {
                        $status->fatal( 'backend-fail-connect', $this->name );
+
                        return $status;
                }
 
@@ -1451,9 +1472,9 @@ class SwiftFileBackend extends FileBackendStore {
                }
 
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                       'method'  => 'GET',
-                       'url'     => $this->storageUrl( $auth, $fullCont ),
-                       'query'   => $query,
+                       'method' => 'GET',
+                       'url' => $this->storageUrl( $auth, $fullCont ),
+                       'query' => $query,
                        'headers' => $this->authTokenHeaders( $auth )
                ) );
 
@@ -1506,29 +1527,34 @@ class SwiftFileBackend extends FileBackendStore {
                                $this->authSessionTimestamp = time() - ceil( $this->authTTL / 2 );
                        } else { // cache miss
                                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
-                                       'method'  => 'GET',
-                                       'url'     => "{$this->swiftAuthUrl}/v1.0",
+                                       'method' => 'GET',
+                                       'url' => "{$this->swiftAuthUrl}/v1.0",
                                        'headers' => array(
-                                               'x-auth-user' => $this->swiftUser, 'x-auth-key' => $this->swiftKey )
+                                               'x-auth-user' => $this->swiftUser,
+                                               'x-auth-key' => $this->swiftKey
+                                       )
                                ) );
 
                                if ( $rcode >= 200 && $rcode <= 299 ) { // OK
                                        $this->authCreds = array(
-                                               'auth_token'  => $rhdrs['x-auth-token'],
+                                               'auth_token' => $rhdrs['x-auth-token'],
                                                'storage_url' => $rhdrs['x-storage-url']
                                        );
                                        $this->authSessionTimestamp = time();
                                } elseif ( $rcode === 401 ) {
                                        $this->onError( null, __METHOD__, array(), "Authentication failed.", $rcode );
                                        $this->authErrorTimestamp = time();
+
                                        return null;
                                } else {
                                        $this->onError( null, __METHOD__, array(), "HTTP return code: $rcode", $rcode );
                                        $this->authErrorTimestamp = time();
+
                                        return null;
                                }
                        }
                }
+
                return $this->authCreds;
        }
 
@@ -1546,6 +1572,7 @@ class SwiftFileBackend extends FileBackendStore {
                if ( strlen( $object ) ) {
                        $parts[] = str_replace( "%2F", "/", rawurlencode( $object ) );
                }
+
                return implode( '/', $parts );
        }
 
index d17074e..a692012 100644 (file)
@@ -178,8 +178,8 @@ abstract class QuorumLockManager extends LockManager {
                foreach ( $this->srvsByBucket[$bucket] as $lockSrv ) {
                        if ( !$this->isServerUp( $lockSrv ) ) {
                                $status->warning( 'lockmanager-fail-svr-release', $lockSrv );
-                       // Attempt to release the lock on this peer
                        } else {
+                               // Attempt to release the lock on this peer
                                $status->merge( $this->freeLocksOnServer( $lockSrv, $pathsByType ) );
                                ++$yesVotes; // success for this peer
                                // Normally the first peers form the quorum, and the others are ignored.
index ca8c219..534d7f2 100644 (file)
@@ -55,7 +55,7 @@ class FileRepo {
        /** @var Array Map of zones to config */
        protected $zones = array();
 
-       /** @var string URL of thumb.php  */
+       /** @var string URL of thumb.php */
        protected $thumbScriptUrl;
 
        /** @var bool Whether to skip media file transformation on parse and rely
@@ -111,7 +111,7 @@ class FileRepo {
         */
        protected $abbrvThreshold;
 
-       /** @var string The URL of the repo's favicon, if any  */
+       /** @var string The URL of the repo's favicon, if any */
        protected $favicon;
 
        /**
@@ -505,7 +505,7 @@ class FileRepo {
                                $searchName = File::normalizeTitle( $title )->getDBkey(); // must be valid
                                if ( $flags & self::NAME_AND_TIME_ONLY ) {
                                        $result[$searchName] = array(
-                                               'title'     => $file->getTitle()->getDBkey(),
+                                               'title' => $file->getTitle()->getDBkey(),
                                                'timestamp' => $file->getTimestamp()
                                        );
                                } else {
index 8ae53de..4e48932 100644 (file)
@@ -59,10 +59,10 @@ class ForeignAPIRepo extends FileRepo {
        /** @var int Redownload thumbnail files after a month (86400*30) */
        protected $fileCacheExpiry = 2592000;
 
-       /** @var array  */
+       /** @var array */
        protected $mFileExists = array();
 
-       /** @var array  */
+       /** @var array */
        private $mQueryCache = array();
 
        /**
index bcccb71..3f7adb0 100644 (file)
@@ -258,11 +258,12 @@ class LocalRepo extends FileRepo {
                        }
                }
 
-               $fileMatchesSearch = function( File $file, array $search ) {
+               $fileMatchesSearch = function ( File $file, array $search ) {
                        // Note: file name comparison done elsewhere (to handle redirects)
                        $user = ( !empty( $search['private'] ) && $search['private'] instanceof User )
                                ? $search['private']
                                : null;
+
                        return (
                                $file->exists() &&
                                (
@@ -275,7 +276,7 @@ class LocalRepo extends FileRepo {
                };
 
                $repo = $this;
-               $applyMatchingFiles = function( ResultWrapper $res, &$searchSet, &$finalFiles )
+               $applyMatchingFiles = function ( ResultWrapper $res, &$searchSet, &$finalFiles )
                        use ( $repo, $fileMatchesSearch, $flags )
                {
                        global $wgContLang;
@@ -290,7 +291,7 @@ class LocalRepo extends FileRepo {
                                        $dbKeysLook[] = $wgContLang->lcfirst( $file->getName() );
                                }
                                foreach ( $dbKeysLook as $dbKey ) {
-                                       if ( isset( $searchSet[$dbKey])
+                                       if ( isset( $searchSet[$dbKey] )
                                                && $fileMatchesSearch( $file, $searchSet[$dbKey] )
                                        ) {
                                                $finalFiles[$dbKey] = ( $flags & FileRepo::NAME_AND_TIME_ONLY )
@@ -309,6 +310,7 @@ class LocalRepo extends FileRepo {
                foreach ( array_keys( $searchSet ) as $dbKey ) {
                        $imgNames[] = $this->getNameFromTitle( File::normalizeTitle( $dbKey ) );
                }
+
                if ( count( $imgNames ) ) {
                        $res = $dbr->select( 'image',
                                LocalFile::selectFields(), array( 'img_name' => $imgNames ), __METHOD__ );
@@ -328,6 +330,7 @@ class LocalRepo extends FileRepo {
                                );
                        }
                }
+
                if ( count( $oiConds ) ) {
                        $res = $dbr->select( 'oldimage',
                                OldLocalFile::selectFields(), $dbr->makeList( $oiConds, LIST_OR ), __METHOD__ );
@@ -339,15 +342,17 @@ class LocalRepo extends FileRepo {
                        if ( !empty( $search['ignoreRedirect'] ) ) {
                                continue;
                        }
+
                        $title = File::normalizeTitle( $dbKey );
                        $redir = $this->checkRedirect( $title ); // hopefully hits memcached
+
                        if ( $redir && $redir->getNamespace() == NS_FILE ) {
                                $file = $this->newFile( $redir );
                                if ( $file && $fileMatchesSearch( $file, $search ) ) {
                                        $file->redirectedFrom( $title->getDBkey() );
                                        if ( $flags & FileRepo::NAME_AND_TIME_ONLY ) {
                                                $finalFiles[$dbKey] = array(
-                                                       'title'     => $file->getTitle()->getDBkey(),
+                                                       'title' => $file->getTitle()->getDBkey(),
                                                        'timestamp' => $file->getTimestamp()
                                                );
                                        } else {
@@ -503,6 +508,7 @@ class LocalRepo extends FileRepo {
         */
        function getInfo() {
                global $wgFavicon;
+
                return array_merge( parent::getInfo(), array(
                        'favicon' => wfExpandUrl( $wgFavicon ),
                ) );
index 33ab8ae..18432a1 100644 (file)
@@ -42,7 +42,7 @@ class RepoGroup {
        /** @var array */
        protected $foreignInfo;
 
-       /** @var ProcessCacheLRU  */
+       /** @var ProcessCacheLRU */
        protected $cache;
 
        /** @var RepoGroup */
index 26699c4..439c25f 100644 (file)
@@ -470,7 +470,6 @@ class ArchivedFile {
                }
 
                throw new MWException( "Unknown type '$type'." );
-
        }
 
        /**
index c9e435e..950baea 100644 (file)
@@ -97,10 +97,10 @@ abstract class File {
        /** @var Title|string|bool */
        protected $title;
 
-       /** @var string Text of last error  */
+       /** @var string Text of last error */
        protected $lastError;
 
-       /** @var string Main part of the title, with underscores (Title::getDBkey)  */
+       /** @var string Main part of the title, with underscores (Title::getDBkey) */
        protected $redirected;
 
        /** @var Title */
@@ -586,6 +586,7 @@ abstract class File {
                if ( !$handler ) {
                        return false;
                }
+
                return $handler->getCommonMetaArray( $this );
        }
 
@@ -1328,7 +1329,7 @@ abstract class File {
                $this->assertRepoDefined();
 
                return $this->repo->getZonePath( 'thumb' ) . '/' .
-                       $this->getArchiveThumbRel( $archiveName, $suffix );
+               $this->getArchiveThumbRel( $archiveName, $suffix );
        }
 
        /**
index 687c549..c7b257a 100644 (file)
@@ -2249,10 +2249,10 @@ class LocalFileRestoreBatch {
        /** @var array List of file IDs to restore */
        private $ids;
 
-       /** @var bool Add all revisions of the file  */
+       /** @var bool Add all revisions of the file */
        private $all;
 
-       /** @var bool Wether to remove all settings for suppressed fields  */
+       /** @var bool Wether to remove all settings for suppressed fields */
        private $unsuppress = false;
 
        /**
@@ -2620,16 +2620,12 @@ class LocalFileMoveBatch {
        /** @var Title */
        protected $target;
 
-       /** @var   */
        protected $cur;
 
-       /** @var   */
        protected $olds;
 
-       /** @var   */
        protected $oldCount;
 
-       /** @var   */
        protected $archive;
 
        /** @var DatabaseBase */
index 782e23a..5a3e4e9 100644 (file)
@@ -34,7 +34,7 @@
  * @ingroup FileAbstraction
  */
 class UnregisteredLocalFile extends File {
-       /** @var Title  */
+       /** @var Title */
        protected $title;
 
        /** @var string */
index a341601..d2e4689 100644 (file)
  * @ingroup Media
  */
 abstract class ImageGalleryBase extends ContextSource {
-       /** @var array Gallery images  */
+       /** @var array Gallery images */
        protected $mImages;
 
-       /** @var bool Whether to show the filesize in bytes in categories   */
+       /** @var bool Whether to show the filesize in bytes in categories */
        protected $mShowBytes;
 
        /** @var bool Whether to show the filename. Default: true */
@@ -242,7 +242,7 @@ abstract class ImageGalleryBase extends ContextSource {
         * @param string $html Additional HTML text to be shown. The name and size
         *   of the image are always shown.
         * @param string $alt Alt text for the image
-        * @param string $link  Override image link (optional)
+        * @param string $link Override image link (optional)
         * @param array $handlerOpts Array of options for image handler (aka page number)
         */
        function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) {
index 622dd94..dcdba1e 100644 (file)
@@ -495,7 +495,7 @@ abstract class HTMLFormField {
 
                $ret = array();
 
-               foreach( $list as $key ) {
+               foreach ( $list as $key ) {
                        if ( in_array( $key, $boolAttribs ) ) {
                                if ( !empty( $this->mParams[$key] ) ) {
                                        $ret[$key] = '';
index 79a42ba..edc0feb 100644 (file)
@@ -641,15 +641,19 @@ abstract class Installer {
                if ( !$status->isOK() ) {
                        return $status;
                }
-               $status->value->insert( 'site_stats', array(
-                       'ss_row_id' => 1,
-                       'ss_total_views' => 0,
-                       'ss_total_edits' => 0,
-                       'ss_good_articles' => 0,
-                       'ss_total_pages' => 0,
-                       'ss_users' => 0,
-                       'ss_images' => 0 ),
-                       __METHOD__, 'IGNORE' );
+               $status->value->insert(
+                       'site_stats',
+                       array(
+                               'ss_row_id' => 1,
+                               'ss_total_views' => 0,
+                               'ss_total_edits' => 0,
+                               'ss_good_articles' => 0,
+                               'ss_total_pages' => 0,
+                               'ss_users' => 0,
+                               'ss_images' => 0
+                       ),
+                       __METHOD__, 'IGNORE'
+               );
 
                return Status::newGood();
        }
index 68664c9..77c35b8 100644 (file)
@@ -223,7 +223,8 @@ class LocalSettingsGenerator {
                        }
                        if ( $this->groupPermissions['*']['edit'] === false
                                && $this->groupPermissions['*']['createaccount'] === false
-                               && $this->groupPermissions['*']['read'] !== false ) {
+                               && $this->groupPermissions['*']['read'] !== false
+                       ) {
                                $noFollow = "\n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n"
                                        . "# the general public and wish to apply nofollow to external links as a\n"
                                        . "# deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n"
index 88e5fbd..6c56b3a 100644 (file)
@@ -94,8 +94,8 @@ class OracleUpdater extends DatabaseUpdater {
                                'patch-ufg_group-length-increase-255.sql' ),
 
                        //1.23
-                       array( 'addIndex', 'logging', 'i06',  'patch-logging_user_text_type_time_index.sql' ),
-                       array( 'addIndex', 'logging', 'i07',  'patch-logging_user_text_time_index.sql' ),
+                       array( 'addIndex', 'logging', 'i06', 'patch-logging_user_text_type_time_index.sql' ),
+                       array( 'addIndex', 'logging', 'i07', 'patch-logging_user_text_time_index.sql' ),
 
                        // KEEP THIS AT THE BOTTOM!!
                        array( 'doRebuildDuplicateFunction' ),
index 7841fca..1e0651c 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup Deployment
  * @since 1.17
  */
-
 class PostgresUpdater extends DatabaseUpdater {
 
        /**
index 5d4f6de..2869d1f 100644 (file)
@@ -125,7 +125,7 @@ class SqliteUpdater extends DatabaseUpdater {
                        array( 'addField', 'recentchanges', 'rc_source', 'patch-rc_source.sql' ),
                        array( 'addIndex', 'logging', 'log_user_text_type_time',
                                'patch-logging_user_text_type_time_index.sql' ),
-                       array( 'addIndex', 'logging', 'log_user_text_time',  'patch-logging_user_text_time_index.sql' ),
+                       array( 'addIndex', 'logging', 'log_user_text_time', 'patch-logging_user_text_time_index.sql' ),
                        array( 'addField', 'page', 'page_links_updated', 'patch-page_links_updated.sql' ),
                );
        }
index 67236e5..131431a 100644 (file)
@@ -1291,7 +1291,7 @@ class WebInstaller_Complete extends WebInstallerPage {
                ) {
                        // JS appears to be the only method that works consistently with IE7+
                        $this->addHtml( "\n<script>jQuery( function () { document.location = " .
-                       Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
+                               Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
                } else {
                        $this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
                }