Merge "Moved ChronologyProtector to its own file."
authorBrion VIBBER <brion@wikimedia.org>
Thu, 11 Apr 2013 21:47:48 +0000 (21:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 11 Apr 2013 21:47:48 +0000 (21:47 +0000)
16 files changed:
includes/Action.php
includes/Block.php
includes/Category.php
includes/Exception.php
includes/db/Database.php
includes/db/DatabaseMssql.php
includes/db/DatabasePostgres.php
includes/db/DatabaseUtility.php
includes/db/LBFactory.php
includes/installer/WebInstallerPage.php
includes/job/JobQueueDB.php
includes/templates/Usercreate.php
includes/templates/Userlogin.php
includes/upload/UploadBase.php
includes/upload/UploadFromChunks.php
includes/upload/UploadFromUrl.php

index 2e0c88b..dff3803 100644 (file)
@@ -374,18 +374,23 @@ abstract class FormAction extends Action {
         * Add pre- or post-text to the form
         * @return String HTML which will be sent to $form->addPreText()
         */
-       protected function preText() { return ''; }
+       protected function preText() {
+               return '';
+       }
 
        /**
         * @return string
         */
-       protected function postText() { return ''; }
+       protected function postText() {
+               return '';
+       }
 
        /**
         * Play with the HTMLForm if you need to more substantially
         * @param $form HTMLForm
         */
-       protected function alterForm( HTMLForm $form ) {}
+       protected function alterForm( HTMLForm $form ) {
+       }
 
        /**
         * Get the HTMLForm to control behavior
index 4da0f8f..1d98a29 100644 (file)
@@ -801,7 +801,8 @@ class Block {
                        case self::TYPE_RANGE:
                                list( $start, /*...*/ ) = IP::parseRange( $this->target );
                                return $start;
-                       default: throw new MWException( "Block with invalid type" );
+                       default:
+                               throw new MWException( "Block with invalid type" );
                }
        }
 
@@ -819,7 +820,8 @@ class Block {
                        case self::TYPE_RANGE:
                                list( /*...*/, $end ) = IP::parseRange( $this->target );
                                return $end;
-                       default: throw new MWException( "Block with invalid type" );
+                       default:
+                               throw new MWException( "Block with invalid type" );
                }
        }
 
index 868d6c4..126b8fe 100644 (file)
@@ -40,7 +40,8 @@ class Category {
        /** Counts of membership (cat_pages, cat_subcats, cat_files) */
        private $mPages = null, $mSubcats = null, $mFiles = null;
 
-       private function __construct() { }
+       private function __construct() {
+       }
 
        /**
         * Set up all member variables using a database query.
index 21952bb..661d03d 100644 (file)
@@ -721,8 +721,10 @@ class MWExceptionHandler {
                // Final cleanup
                if ( $wgFullyInitialised ) {
                        try {
-                               wfLogProfilingData(); // uses $wgRequest, hence the $wgFullyInitialised condition
-                       } catch ( Exception $e ) {}
+                               // uses $wgRequest, hence the $wgFullyInitialised condition
+                               wfLogProfilingData();
+                       } catch ( Exception $e ) {
+                       }
                }
 
                // Exit value should be nonzero for the benefit of shell jobs
index 9db2ada..2142232 100644 (file)
@@ -1094,17 +1094,22 @@ abstract class DatabaseBase implements DatabaseType {
         * @return String
         */
        protected function fillPreparedArg( $matches ) {
-               switch( $matches[1] ) {
-                       case '\\?': return '?';
-                       case '\\!': return '!';
-                       case '\\&': return '&';
+               switch ( $matches[1] ) {
+                       case '\\?':
+                               return '?';
+                       case '\\!':
+                               return '!';
+                       case '\\&':
+                               return '&';
                }
 
                list( /* $n */, $arg ) = each( $this->preparedArgs );
 
-               switch( $matches[1] ) {
-                       case '?': return $this->addQuotes( $arg );
-                       case '!': return $arg;
+               switch ( $matches[1] ) {
+                       case '?':
+                               return $this->addQuotes( $arg );
+                       case '!':
+                               return $arg;
                        case '&':
                                # return $this->addQuotes( file_get_contents( $arg ) );
                                throw new DBUnexpectedError( $this, '& mode is not implemented. If it\'s really needed, uncomment the line above.' );
@@ -1120,7 +1125,8 @@ abstract class DatabaseBase implements DatabaseType {
         *
         * @param $res Mixed: A SQL result
         */
-       public function freeResult( $res ) {}
+       public function freeResult( $res ) {
+       }
 
        /**
         * A SELECT wrapper which returns a single field from a single result row.
@@ -1140,8 +1146,8 @@ abstract class DatabaseBase implements DatabaseType {
         * @return bool|mixed The value from the field, or false on failure.
         */
        public function selectField( $table, $var, $cond = '', $fname = 'DatabaseBase::selectField',
-               $options = array() )
-       {
+               $options = array()
+       {
                if ( !is_array( $options ) ) {
                        $options = array( $options );
                }
@@ -2991,7 +2997,8 @@ abstract class DatabaseBase implements DatabaseType {
                                        $this->clearFlag( DBO_TRX ); // make each query its own transaction
                                        $callback();
                                        $this->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore automatic begin()
-                               } catch ( Exception $e ) {}
+                               } catch ( Exception $e ) {
+                               }
                        }
                } while ( count( $this->mTrxIdleCallbacks ) );
 
@@ -3028,7 +3035,8 @@ abstract class DatabaseBase implements DatabaseType {
                                // log it if $wgDebugDBTransactions is enabled.
                                if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) {
                                        wfDebug( "$fname: Automatic transaction with writes in progress" .
-                                               " (from {$this->mTrxFname}), performing implicit commit!\n" );
+                                               " (from {$this->mTrxFname}), performing implicit commit!\n"
+                                       );
                                }
                        }
 
@@ -3142,8 +3150,8 @@ abstract class DatabaseBase implements DatabaseType {
         * @return Boolean: true if operation was successful
         */
        public function duplicateTableStructure( $oldName, $newName, $temporary = false,
-               $fname = 'DatabaseBase::duplicateTableStructure' )
-       {
+               $fname = 'DatabaseBase::duplicateTableStructure'
+       {
                throw new MWException(
                        'DatabaseBase::duplicateTableStructure is not implemented in descendant class' );
        }
@@ -3288,7 +3296,8 @@ abstract class DatabaseBase implements DatabaseType {
         * @param $options Array
         * @return void
         */
-       public function setSessionOptions( array $options ) {}
+       public function setSessionOptions( array $options ) {
+       }
 
        /**
         * Read and execute SQL commands from a file.
index dde3af5..82b0e5a 100644 (file)
@@ -37,24 +37,31 @@ class DatabaseMssql extends DatabaseBase {
        function cascadingDeletes() {
                return true;
        }
+
        function cleanupTriggers() {
                return true;
        }
+
        function strictIPs() {
                return true;
        }
+
        function realTimestamps() {
                return true;
        }
+
        function implicitGroupby() {
                return false;
        }
+
        function implicitOrderby() {
                return false;
        }
+
        function functionalIndexes() {
                return true;
        }
+
        function unionSupportsOrderAndLimit() {
                return false;
        }
@@ -1093,37 +1100,96 @@ class MssqlResult {
                        $i++;
                }
                // http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table
-               switch( $intType ) {
-                       case SQLSRV_SQLTYPE_BIGINT:             $strType = 'bigint'; break;
-                       case SQLSRV_SQLTYPE_BINARY:             $strType = 'binary'; break;
-                       case SQLSRV_SQLTYPE_BIT:                        $strType = 'bit'; break;
-                       case SQLSRV_SQLTYPE_CHAR:                       $strType = 'char'; break;
-                       case SQLSRV_SQLTYPE_DATETIME:           $strType = 'datetime'; break;
-                       case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $strType = 'decimal'; break;
-                       case SQLSRV_SQLTYPE_FLOAT:                      $strType = 'float'; break;
-                       case SQLSRV_SQLTYPE_IMAGE:                      $strType = 'image'; break;
-                       case SQLSRV_SQLTYPE_INT:                        $strType = 'int'; break;
-                       case SQLSRV_SQLTYPE_MONEY:                      $strType = 'money'; break;
-                       case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $strType = 'nchar'; break;
-                       case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $strType = 'numeric'; break;
-                       case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $strType = 'nvarchar'; break;
-                       // case SQLSRV_SQLTYPE_NVARCHAR('max'): $strType = 'nvarchar(MAX)'; break;
-                       case SQLSRV_SQLTYPE_NTEXT:                      $strType = 'ntext'; break;
-                       case SQLSRV_SQLTYPE_REAL:                       $strType = 'real'; break;
-                       case SQLSRV_SQLTYPE_SMALLDATETIME:      $strType = 'smalldatetime'; break;
-                       case SQLSRV_SQLTYPE_SMALLINT:           $strType = 'smallint'; break;
-                       case SQLSRV_SQLTYPE_SMALLMONEY:         $strType = 'smallmoney'; break;
-                       case SQLSRV_SQLTYPE_TEXT:                       $strType = 'text'; break;
-                       case SQLSRV_SQLTYPE_TIMESTAMP:          $strType = 'timestamp'; break;
-                       case SQLSRV_SQLTYPE_TINYINT:            $strType = 'tinyint'; break;
-                       case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $strType = 'uniqueidentifier'; break;
-                       case SQLSRV_SQLTYPE_UDT:                        $strType = 'UDT'; break;
-                       case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $strType = 'varbinary'; break;
-                       // case SQLSRV_SQLTYPE_VARBINARY('max'): $strType = 'varbinary(MAX)'; break;
-                       case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $strType = 'varchar'; break;
-                       // case SQLSRV_SQLTYPE_VARCHAR('max'): $strType = 'varchar(MAX)'; break;
-                       case SQLSRV_SQLTYPE_XML:                        $strType = 'xml'; break;
-                       default: $strType = $intType;
+               switch ( $intType ) {
+                       case SQLSRV_SQLTYPE_BIGINT:
+                               $strType = 'bigint';
+                               break;
+                       case SQLSRV_SQLTYPE_BINARY:
+                               $strType = 'binary';
+                               break;
+                       case SQLSRV_SQLTYPE_BIT:
+                               $strType = 'bit';
+                               break;
+                       case SQLSRV_SQLTYPE_CHAR:
+                               $strType = 'char';
+                               break;
+                       case SQLSRV_SQLTYPE_DATETIME:
+                               $strType = 'datetime';
+                               break;
+                       case SQLSRV_SQLTYPE_DECIMAL: // ($precision, $scale)
+                               $strType = 'decimal';
+                               break;
+                       case SQLSRV_SQLTYPE_FLOAT:
+                               $strType = 'float';
+                               break;
+                       case SQLSRV_SQLTYPE_IMAGE:
+                               $strType = 'image';
+                               break;
+                       case SQLSRV_SQLTYPE_INT:
+                               $strType = 'int';
+                               break;
+                       case SQLSRV_SQLTYPE_MONEY:
+                               $strType = 'money';
+                               break;
+                       case SQLSRV_SQLTYPE_NCHAR: // ($charCount):
+                               $strType = 'nchar';
+                               break;
+                       case SQLSRV_SQLTYPE_NUMERIC: // ($precision, $scale):
+                               $strType = 'numeric';
+                               break;
+                       case SQLSRV_SQLTYPE_NVARCHAR: // ($charCount)
+                               $strType = 'nvarchar';
+                               break;
+                       // case SQLSRV_SQLTYPE_NVARCHAR('max'):
+                       //       $strType = 'nvarchar(MAX)';
+                       //       break;
+                       case SQLSRV_SQLTYPE_NTEXT:
+                               $strType = 'ntext';
+                               break;
+                       case SQLSRV_SQLTYPE_REAL:
+                               $strType = 'real';
+                               break;
+                       case SQLSRV_SQLTYPE_SMALLDATETIME:
+                               $strType = 'smalldatetime';
+                               break;
+                       case SQLSRV_SQLTYPE_SMALLINT:
+                               $strType = 'smallint';
+                               break;
+                       case SQLSRV_SQLTYPE_SMALLMONEY:
+                               $strType = 'smallmoney';
+                               break;
+                       case SQLSRV_SQLTYPE_TEXT:
+                               $strType = 'text';
+                               break;
+                       case SQLSRV_SQLTYPE_TIMESTAMP:
+                               $strType = 'timestamp';
+                               break;
+                       case SQLSRV_SQLTYPE_TINYINT:
+                               $strType = 'tinyint';
+                               break;
+                       case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER:
+                               $strType = 'uniqueidentifier';
+                               break;
+                       case SQLSRV_SQLTYPE_UDT:
+                               $strType = 'UDT';
+                               break;
+                       case SQLSRV_SQLTYPE_VARBINARY: // ($byteCount)
+                               $strType = 'varbinary';
+                               break;
+                       // case SQLSRV_SQLTYPE_VARBINARY('max'):
+                       //       $strType = 'varbinary(MAX)';
+                       //       break;
+                       case SQLSRV_SQLTYPE_VARCHAR: // ($charCount)
+                               $strType = 'varchar';
+                               break;
+                       // case SQLSRV_SQLTYPE_VARCHAR('max'):
+                       //       $strType = 'varchar(MAX)';
+                       //       break;
+                       case SQLSRV_SQLTYPE_XML:
+                               $strType = 'xml';
+                               break;
+                       default:
+                               $strType = $intType;
                }
                return $strType;
        }
index 55e0f88..52fab13 100644 (file)
@@ -1408,7 +1408,8 @@ SQL;
                return array( $startOpts, $useIndex, $preLimitTail, $postLimitTail );
        }
 
-       function setFakeMaster( $enabled = true ) {}
+       function setFakeMaster( $enabled = true ) {
+       }
 
        function getDBname() {
                return $this->mDBname;
index 9a1c8bd..de58bab 100644 (file)
@@ -253,7 +253,8 @@ class FakeResultWrapper extends ResultWrapper {
                $this->pos = $row;
        }
 
-       function free() {}
+       function free() {
+       }
 
        // Callers want to be able to access fields with $this->fieldName
        function fetchObject() {
index 1fcc69a..55d1850 100644 (file)
@@ -134,7 +134,8 @@ abstract class LBFactory {
         * Prepare all tracked load balancers for shutdown
         * STUB
         */
-       function shutdown() {}
+       function shutdown() {
+       }
 
        /**
         * Call a method of each tracked load balancer
@@ -292,21 +293,27 @@ class LBFactory_Simple extends LBFactory {
  * LBFactory::enableBackend() to return to normal behavior
  */
 class LBFactory_Fake extends LBFactory {
-       function __construct( $conf ) {}
+       function __construct( $conf ) {
+       }
 
        function newMainLB( $wiki = false) {
                throw new DBAccessError;
        }
+
        function getMainLB( $wiki = false ) {
                throw new DBAccessError;
        }
+
        function newExternalLB( $cluster, $wiki = false ) {
                throw new DBAccessError;
        }
+
        function &getExternalLB( $cluster, $wiki = false ) {
                throw new DBAccessError;
        }
-       function forEachLB( $callback, $params = array() ) {}
+
+       function forEachLB( $callback, $params = array() ) {
+       }
 }
 
 /**
index 593509e..8aec289 100644 (file)
@@ -1311,7 +1311,9 @@ abstract class WebInstaller_Document extends WebInstallerPage {
 }
 
 class WebInstaller_Readme extends WebInstaller_Document {
-       protected function getFileName() { return 'README'; }
+       protected function getFileName() {
+               return 'README';
+       }
 }
 
 class WebInstaller_ReleaseNotes extends WebInstaller_Document {
@@ -1327,9 +1329,13 @@ class WebInstaller_ReleaseNotes extends WebInstaller_Document {
 }
 
 class WebInstaller_UpgradeDoc extends WebInstaller_Document {
-       protected function getFileName() { return 'UPGRADE'; }
+       protected function getFileName() {
+               return 'UPGRADE';
+       }
 }
 
 class WebInstaller_Copying extends WebInstaller_Document {
-       protected function getFileName() { return 'COPYING'; }
+       protected function getFileName() {
+               return 'COPYING';
+       }
 }
index ae4576c..d1e6eb4 100644 (file)
@@ -195,12 +195,13 @@ class JobQueueDB extends JobQueue {
                        $key = $this->getCacheKey( 'empty' );
                        $atomic = ( $flags & self::QOS_ATOMIC );
                        $cache = $this->cache;
+                       $method = __METHOD__;
 
                        $dbw->onTransactionIdle(
-                               function() use ( $dbw, $cache, $rowSet, $rowList, $atomic, $key, $scope
+                               function() use ( $dbw, $cache, $rowSet, $rowList, $atomic, $key, $method, $scope
                        ) {
                                if ( $atomic ) {
-                                       $dbw->begin( __METHOD__ ); // wrap all the job additions in one transaction
+                                       $dbw->begin( $method ); // wrap all the job additions in one transaction
                                }
                                try {
                                        // Strip out any duplicate jobs that are already in the queue...
@@ -211,7 +212,7 @@ class JobQueueDB extends JobQueue {
                                                                'job_sha1'  => array_keys( $rowSet ),
                                                                'job_token' => '' // unclaimed
                                                        ),
-                                                       __METHOD__
+                                                       $method
                                                );
                                                foreach ( $res as $row ) {
                                                        wfDebug( "Job with hash '{$row->job_sha1}' is a duplicate." );
@@ -222,19 +223,19 @@ class JobQueueDB extends JobQueue {
                                        $rows = array_merge( $rowList, array_values( $rowSet ) );
                                        // Insert the job rows in chunks to avoid slave lag...
                                        foreach ( array_chunk( $rows, 50 ) as $rowBatch ) {
-                                               $dbw->insert( 'job', $rowBatch, __METHOD__ );
+                                               $dbw->insert( 'job', $rowBatch, $method );
                                        }
                                        wfIncrStats( 'job-insert', count( $rows ) );
                                        wfIncrStats( 'job-insert-duplicate',
                                                count( $rowSet ) + count( $rowList ) - count( $rows ) );
                                } catch ( DBError $e ) {
                                        if ( $atomic ) {
-                                               $dbw->rollback( __METHOD__ );
+                                               $dbw->rollback( $method );
                                        }
                                        throw $e;
                                }
                                if ( $atomic ) {
-                                       $dbw->commit( __METHOD__ );
+                                       $dbw->commit( $method );
                                }
 
                                $cache->set( $key, 'false', JobQueueDB::CACHE_TTL_LONG );
index 541d9e4..dff9ada 100644 (file)
@@ -25,7 +25,9 @@
  * @defgroup Templates Templates
  */
 
-if( !defined( 'MEDIAWIKI' ) ) die( -1 );
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die( -1 );
+}
 
 /**
  * @ingroup Templates
@@ -42,16 +44,20 @@ class UsercreateTemplate extends QuickTemplate {
        }
 
        function execute() {
-               if( $this->data['message'] ) {
+               if ( $this->data['message'] ) {
 ?>
        <div class="<?php $this->text('messagetype') ?>box">
-               <?php if ( $this->data['messagetype'] == 'error' ) { ?>
-                       <strong><?php $this->msg( 'loginerror' )?></strong><br />
-               <?php } ?>
-               <?php $this->html('message') ?>
+<?php
+                       if ( $this->data['messagetype'] == 'error' ) {
+                               ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+                       }
+                       $this->html('message');
+?>
        </div>
        <div class="visualClear"></div>
-<?php } ?>
+<?php
+               }
+?>
 
 <div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div>
 <div id="userlogin">
@@ -60,7 +66,11 @@ class UsercreateTemplate extends QuickTemplate {
        <h2><?php $this->msg('createaccount') ?></h2>
        <p id="userloginlink"><?php $this->html('link') ?></p>
        <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
-       <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+<?php
+       if ( $this->haveData( 'languages' ) ) {
+               ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
+       }
+?>
        <table>
                <tr>
                        <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
@@ -79,7 +89,8 @@ class UsercreateTemplate extends QuickTemplate {
                <tr>
                        <td></td>
                        <td class="mw-input">
-                               <?php if( $this->data['createemail'] ) {
+<?php
+                               if ( $this->data['createemail'] ) {
                                        echo Xml::checkLabel(
                                                wfMessage( 'createaccountmail' )->text(),
                                                'wpCreateaccountMail',
@@ -87,7 +98,8 @@ class UsercreateTemplate extends QuickTemplate {
                                                $this->data['createemailset'],
                                                array( 'tabindex' => '2' )
                                        );
-                               } ?>
+                               }
+?>
                        </td>
                </tr>
                <tr class="mw-row-password">
@@ -102,12 +114,13 @@ class UsercreateTemplate extends QuickTemplate {
                        ) + User::passwordChangeInputAttribs() ); ?>
                        </td>
                </tr>
-       <?php if( $this->data['usedomain'] ) {
+<?php
+               if ( $this->data['usedomain'] ) {
                $doms = "";
-               foreach( $this->data['domainnames'] as $dom ) {
+               foreach ( $this->data['domainnames'] as $dom ) {
                        $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
                }
-       ?>
+?>
                <tr id="mw-user-domain-section">
                        <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
                        <td class="mw-input">
@@ -117,7 +130,9 @@ class UsercreateTemplate extends QuickTemplate {
                                </select>
                        </td>
                </tr>
-       <?php } ?>
+<?php
+               }
+?>
                <tr class="mw-row-password">
                        <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
                        <td class="mw-input">
@@ -131,7 +146,9 @@ class UsercreateTemplate extends QuickTemplate {
                        </td>
                </tr>
                <tr>
-                       <?php if( $this->data['useemail'] ) { ?>
+<?php
+               if ( $this->data['useemail'] ) {
+?>
                                <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
                                <td class="mw-input">
                                        <?php
@@ -153,8 +170,11 @@ class UsercreateTemplate extends QuickTemplate {
                                                        } ?>
                                        </div>
                                </td>
-                       <?php } ?>
-                       <?php if( $this->data['userealname'] ) { ?>
+<?php
+               }
+
+               if ( $this->data['userealname'] ) {
+?>
                                </tr>
                                <tr>
                                        <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
@@ -166,8 +186,11 @@ class UsercreateTemplate extends QuickTemplate {
                                                        <?php $this->msgWiki('prefs-help-realname'); ?>
                                                </div>
                                        </td>
-                       <?php } ?>
-                       <?php if( $this->data['usereason'] ) { ?>
+<?php
+               }
+
+               if ( $this->data['usereason'] ) {
+?>
                                </tr>
                                <tr>
                                        <td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td>
@@ -176,9 +199,13 @@ class UsercreateTemplate extends QuickTemplate {
                                                        tabindex="8"
                                                        value="<?php $this->text('reason') ?>" size='20' />
                                        </td>
-                       <?php } ?>
+<?php
+               }
+?>
                </tr>
-               <?php if( $this->data['canremember'] ) { ?>
+<?php
+               if ( $this->data['canremember'] ) {
+?>
                <tr>
                        <td></td>
                        <td class="mw-input">
@@ -195,7 +222,8 @@ class UsercreateTemplate extends QuickTemplate {
                                ?>
                        </td>
                </tr>
-<?php   }
+<?php
+               }
 
                $tabIndex = 10;
                if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
@@ -230,12 +258,13 @@ class UsercreateTemplate extends QuickTemplate {
                                <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
                                        $this->msgHtml( $inputItem['msg'] ) ?></label><?php
                                        }
-                               if( $inputItem['helptext'] !== false ) {
+                               if ( $inputItem['helptext'] !== false ) {
                                ?>
                                <div class="prefsectiontip">
                                        <?php $this->msgWiki( $inputItem['helptext'] ); ?>
-                               </div>
-                               <?php } ?>
+                               </div><?php
+                               }
+                               ?>
                        </td>
                </tr>
 <?php
@@ -251,8 +280,14 @@ class UsercreateTemplate extends QuickTemplate {
                        </td>
                </tr>
        </table>
-<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php
+       if ( $this->haveData( 'uselang' ) ) {
+               ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php
+       }
+       if ( $this->haveData( 'token' ) ) {
+               ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php
+       }
+?>
 </form>
 </div>
 <div id="signupend"><?php $this->html( 'signupend' ); ?></div>
index 7bc0241..0b4b8e5 100644 (file)
  */
 class UserloginTemplate extends QuickTemplate {
        function execute() {
-               if( $this->data['message'] ) {
+               if ( $this->data['message'] ) {
 ?>
        <div class="<?php $this->text('messagetype') ?>box">
-               <?php if ( $this->data['messagetype'] == 'error' ) { ?>
-                       <strong><?php $this->msg( 'loginerror' )?></strong><br />
-               <?php } ?>
+               <?php
+               if ( $this->data['messagetype'] == 'error' ) {
+                       ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+               }
+               ?>
                <?php $this->html('message') ?>
        </div>
-       <div class="visualClear"></div>
-<?php } ?>
+       <div class="visualClear"></div><?php
 
+               }
+?>
 <div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
 <div id="userloginForm">
 <form name="userlogin" method="post" action="<?php $this->text('action') ?>">
@@ -49,7 +52,11 @@ class UserloginTemplate extends QuickTemplate {
        <p id="userloginlink"><?php $this->html('link') ?></p>
        <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
        <div id="userloginprompt"><?php  $this->msgWiki('loginprompt') ?></div>
-       <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+<?php
+               if ( $this->haveData( 'languages' ) ) {
+                       ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
+               }
+?>
        <table>
                <tr>
                        <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
@@ -80,12 +87,13 @@ class UserloginTemplate extends QuickTemplate {
 
                        </td>
                </tr>
-       <?php if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
+<?php
+               if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
                $doms = "";
-               foreach( $this->data['domainnames'] as $dom ) {
+               foreach ( $this->data['domainnames'] as $dom ) {
                        $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
                }
-       ?>
+?>
                <tr id="mw-user-domain-section">
                        <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
                        <td class="mw-input">
@@ -95,13 +103,15 @@ class UserloginTemplate extends QuickTemplate {
                                </select>
                        </td>
                </tr>
-       <?php }
+<?php
+               }
 
-       if( $this->haveData( 'extrafields' ) ) {
-               echo $this->data['extrafields'];
-       }
+               if ( $this->haveData( 'extrafields' ) ) {
+                       echo $this->data['extrafields'];
+               }
 
-       if( $this->data['canremember'] ) { ?>
+               if ( $this->data['canremember'] ) {
+?>
                <tr>
                        <td></td>
                        <td class="mw-input">
@@ -118,8 +128,11 @@ class UserloginTemplate extends QuickTemplate {
                                ?>
                        </td>
                </tr>
-<?php } ?>
-<?php if( $this->data['cansecurelogin'] ) { ?>
+<?php
+               }
+
+               if ( $this->data['cansecurelogin'] ) {
+?>
                <tr>
                        <td></td>
                        <td class="mw-input">
@@ -131,26 +144,28 @@ class UserloginTemplate extends QuickTemplate {
                                $this->data['stickHTTPS'],
                                array( 'tabindex' => '9' )
                        );
-               ?>
+?>
                        </td>
                </tr>
-<?php } ?>
+<?php
+               }
+?>
                <tr>
                        <td></td>
                        <td class="mw-submit">
-                               <?php
-               echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
-                       'id' => 'wpLoginAttempt',
-                       'tabindex' => '9'
-               ) );
+                       <?php
+                       echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
+                               'id' => 'wpLoginAttempt',
+                               'tabindex' => '9'
+                       ) );
                if ( $this->data['useemail'] && $this->data['canreset'] ) {
-                       if( $this->data['resetlink'] === true ) {
+                       if ( $this->data['resetlink'] === true ) {
                                echo '&#160;';
                                echo Linker::link(
                                        SpecialPage::getTitleFor( 'PasswordReset' ),
                                        wfMessage( 'userlogin-resetlink' )
                                );
-                       } elseif( $this->data['resetlink'] === null ) {
+                       } elseif ( $this->data['resetlink'] === null ) {
                                echo '&#160;';
                                echo Html::input(
                                        'wpMailmypassword',
@@ -161,13 +176,20 @@ class UserloginTemplate extends QuickTemplate {
                                        )
                                );
                        }
-               } ?>
-
+               }
+?>
                        </td>
                </tr>
        </table>
-<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php
+       if ( $this->haveData( 'uselang' ) ) {
+               ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php
+       }
+
+       if ( $this->haveData( 'token' ) ) {
+               ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php
+       }
+?>
 </form>
 </div>
 <div id="loginend"><?php $this->html( 'loginend' ); ?></div>
index 34af8ca..bf809a1 100644 (file)
@@ -187,7 +187,9 @@ abstract class UploadBase {
         * @since 1.18
         * @return string
         */
-       public function getSourceType() { return null; }
+       public function getSourceType() {
+               return null;
+       }
 
        /**
         * Initialize the path information
index 8144c34..7e07516 100644 (file)
@@ -31,7 +31,7 @@ class UploadFromChunks extends UploadFromFile {
        protected $mOffset, $mChunkIndex, $mFileKey, $mVirtualTempPath;
 
        /**
-        * Setup local pointers to stash, repo and user ( similar to UploadFromStash )
+        * Setup local pointers to stash, repo and user (similar to UploadFromStash)
         *
         * @param $user User
         * @param $stash UploadStash
@@ -72,7 +72,7 @@ class UploadFromChunks extends UploadFromFile {
                $this->mOffset = 0;
                // Create a local stash target
                $this->mLocalFile = parent::stashFile();
-               // Update the initial file offset ( based on file size )
+               // Update the initial file offset (based on file size)
                $this->mOffset = $this->mLocalFile->getSize();
                $this->mFileKey = $this->mLocalFile->getFileKey();
 
@@ -132,7 +132,7 @@ class UploadFromChunks extends UploadFromFile {
                }
                wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
                // Update the mTempPath and mLocalFile
-               // ( for FileUpload or normal Stash to take over )
+               // (for FileUpload or normal Stash to take over)
                $this->mTempPath = $tmpPath; // file system path
                $tStart = microtime( true );
                $this->mLocalFile = parent::stashFile( $this->user );
index 70b6903..150e516 100644 (file)
@@ -160,7 +160,9 @@ class UploadFromUrl extends UploadBase {
        /**
         * @return string
         */
-       public function getSourceType() { return 'url'; }
+       public function getSourceType() {
+               return 'url';
+       }
 
        /**
         * @return Status