Removing trailing whitespace
authorSam Reed <reedy@users.mediawiki.org>
Thu, 16 Dec 2010 11:20:39 +0000 (11:20 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 16 Dec 2010 11:20:39 +0000 (11:20 +0000)
includes/installer/DatabaseInstaller.php
includes/installer/DatabaseUpdater.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/installer/MysqlInstaller.php
includes/installer/MysqlUpdater.php
includes/installer/SqliteInstaller.php
includes/installer/SqliteUpdater.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php

index 26cf53c..0345e73 100644 (file)
@@ -13,7 +13,7 @@
  * @since 1.17
  */
 abstract class DatabaseInstaller {
-       
+
        /**
         * The Installer object.
         *
@@ -103,7 +103,7 @@ abstract class DatabaseInstaller {
         * @return Status
         */
        public abstract function getConnection();
-       
+
        /**
         * Create the database and return a Status object indicating success or
         * failure.
@@ -143,7 +143,7 @@ abstract class DatabaseInstaller {
         * @return String
         */
        public abstract function getLocalSettings();
-       
+
        /**
         * Perform database upgrades
         *
@@ -166,21 +166,21 @@ abstract class DatabaseInstaller {
                ob_end_flush();
                return $ret;
        }
-       
+
        /**
         * Allow DB installers a chance to make last-minute changes before installation
         * occurs. This happens before setupDatabase() or createTables() is called, but
         * long after the constructor. Helpful for things like modifying setup steps :)
         */
        public function preInstall() {
-       
+
        }
 
        /**
         * Allow DB installers a chance to make checks before upgrade.
         */
        public function preUpgrade() {
-       
+
        }
 
        /**
@@ -227,7 +227,7 @@ abstract class DatabaseInstaller {
        public function getReadableName() {
                return wfMsg( 'config-type-' . $this->getName() );
        }
-       
+
        /**
         * Get a name=>value map of MW configuration globals that overrides.
         * DefaultSettings.php
@@ -423,12 +423,12 @@ abstract class DatabaseInstaller {
                $this->setVarsFromRequest(
                        array( 'wgDBuser', 'wgDBpassword', '_SameAccount', '_CreateDBAccount' )
                );
-               
+
                if ( $this->getVar( '_SameAccount' ) ) {
                        $this->setVar( 'wgDBuser', $this->getVar( '_InstallUser' ) );
                        $this->setVar( 'wgDBpassword', $this->getVar( '_InstallPassword' ) );
                }
-               
+
                return Status::newGood();
        }
 
index d8b67b7..5b3d6ca 100644 (file)
@@ -11,7 +11,7 @@ require_once( dirname(__FILE__) . '/../../maintenance/Maintenance.php' );
 /*
  * Class for handling database updates. Roughly based off of updaters.inc, with
  * a few improvements :)
- * 
+ *
  * @ingroup Deployment
  * @since 1.17
  */
index c1cc4f5..08763fd 100644 (file)
@@ -334,7 +334,7 @@ abstract class Installer {
        public function restoreLinkPopups() {
                global $wgExternalLinkTarget;
                $this->parserOptions->setExternalLinkTarget( $wgExternalLinkTarget );
-       }       
+       }
 
        /**
         * TODO: document
@@ -349,7 +349,7 @@ abstract class Installer {
                if( $status->isOK() ) {
                        LBFactory::enableBackend();
                }
-               
+
                return $status;
        }
 
index 5cc0e3c..6c49fbd 100644 (file)
  * @since 1.17
  */
 class LocalSettingsGenerator {
-       
+
        private $extensions = array();
        private $values = array();
        private $dbSettings = '';
        private $safeMode = false;
-       
+
        /**
         * @var Installer
         */
@@ -26,7 +26,7 @@ class LocalSettingsGenerator {
 
        /**
         * Constructor.
-        * 
+        *
         * @param $installer Installer subclass
         */
        public function __construct( Installer $installer ) {
@@ -49,27 +49,27 @@ class LocalSettingsGenerator {
                        ),
                        $db->getGlobalNames()
                );
-               
+
                $unescaped = array( 'wgRightsIcon' );
-               $boolItems = array( 
+               $boolItems = array(
                        'wgEnableEmail', 'wgEnableUserEmail', 'wgEnotifUserTalk',
                        'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgEnableUploads', 'wgUseInstantCommons'
                );
-               
+
                foreach( $confItems as $c ) {
                        $val = $installer->getVar( $c );
-                       
+
                        if( in_array( $c, $boolItems ) ) {
                                $val = wfBoolToStr( $val );
                        }
-                       
+
                        if ( !in_array( $c, $unescaped ) ) {
                                $val = self::escapePhpString( $val );
                        }
-                       
+
                        $this->values[$c] = $val;
                }
-               
+
                $this->dbSettings = $db->getLocalSettings();
                $this->safeMode = $installer->getVar( '_SafeMode' );
                $this->values['wgEmergencyContact'] = $this->values['wgPasswordSender'];
@@ -77,16 +77,16 @@ class LocalSettingsGenerator {
 
        /**
         * Returns the escaped version of a string of php code.
-        * 
+        *
         * @param $string String
-        * 
+        *
         * @return String
         */
        public static function escapePhpString( $string ) {
                if ( is_array( $string ) || is_object( $string ) ) {
                        return false;
                }
-               
+
                return strtr(
                        $string,
                        array(
@@ -103,15 +103,15 @@ class LocalSettingsGenerator {
        /**
         * Return the full text of the generated LocalSettings.php file,
         * including the extensions
-        * 
+        *
         * @return String
         */
        public function getText() {
                $localSettings = $this->getDefaultText();
-               
+
                if( count( $this->extensions ) ) {
                        $localSettings .= "\n# The following extensions were automatically enabled:\n";
-                       
+
                        foreach( $this->extensions as $extName ) {
                                $encExtName = self::escapePhpString( $extName );
                                $localSettings .= "require( \"extensions/$encExtName/$encExtName.php\" );\n";
@@ -135,25 +135,25 @@ class LocalSettingsGenerator {
         */
        private function buildMemcachedServerList() {
                $servers = $this->values['_MemCachedServers'];
-               
+
                if( !$servers ) {
                        return 'array()';
                } else {
                        $ret = 'array( ';
                        $servers = explode( ',', $servers );
-                       
+
                        foreach( $servers as $srv ) {
                                $srv = trim( $srv );
                                $ret .= "'$srv', ";
                        }
-                       
+
                        return rtrim( $ret, ', ' ) . ' )';
                }
        }
 
        /**
         * @return String
-        */     
+        */
        private function getDefaultText() {
                if( !$this->values['wgImageMagickConvertCommand'] ) {
                        $this->values['wgImageMagickConvertCommand'] = '/usr/bin/convert';
@@ -161,17 +161,17 @@ class LocalSettingsGenerator {
                } else {
                        $magic = '';
                }
-               
+
                if( !$this->values['wgShellLocale'] ) {
                        $this->values['wgShellLocale'] = 'en_US.UTF-8';
                        $locale = '#';
                } else {
                        $locale = '';
                }
-               
+
                $rights = $this->values['wgRightsUrl'] ? '' : '#';
                $hashedUploads = $this->safeMode ? '' : '#';
-               
+
                switch( $this->values['wgMainCacheType'] ) {
                        case 'anything':
                        case 'db':
@@ -183,7 +183,7 @@ class LocalSettingsGenerator {
                        default:
                                $cacheType = 'CACHE_NONE';
                }
-               
+
                $mcservers = $this->buildMemcachedServerList();
                return "<?php
 # This file was automatically generated by the MediaWiki {$GLOBALS['wgVersion']}
@@ -305,5 +305,5 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 # but check specific extension documentation for more details
 ";
        }
-       
+
 }
index 033875a..67abf43 100644 (file)
@@ -13,7 +13,7 @@
  * @since 1.17
  */
 class MysqlInstaller extends DatabaseInstaller {
-       
+
        protected $globalNames = array(
                'wgDBserver',
                'wgDBname',
index 7e1f8b1..f5031af 100644 (file)
@@ -8,12 +8,12 @@
 
 /**
  * Mysql update list and mysql-specific update functions.
- * 
+ *
  * @ingroup Deployment
  * @since 1.17
  */
 class MysqlUpdater extends DatabaseUpdater {
-       
+
        protected function getCoreUpdateList() {
                return array(
                        // 1.2
@@ -617,8 +617,6 @@ class MysqlUpdater extends DatabaseUpdater {
         * @see bug 3946
         */
        protected function doPageRandomUpdate() {
-               
-
                $page = $this->db->tableName( 'page' );
                $this->db->query( "UPDATE $page SET page_random = RAND() WHERE page_random = 0", __METHOD__ );
                $rows = $this->db->affectedRows();
@@ -693,7 +691,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        $this->output( "...page_restrictions table already exists.\n" );
                        return;
                }
-       
+
                $this->output( "Creating page_restrictions table..." );
                $this->applyPatch( 'patch-page_restrictions.sql' );
                $this->applyPatch( 'patch-page_restrictions_sortkey.sql' );
index d191f6e..9393d83 100644 (file)
@@ -5,7 +5,7 @@
  * @file
  * @ingroup Deployment
  */
+
 /**
  * Class for setting up the MediaWiki database using SQLLite.
  *
@@ -13,7 +13,7 @@
  * @since 1.17
  */
 class SqliteInstaller extends DatabaseInstaller {
-       
+
        protected $globalNames = array(
                'wgDBname',
                'wgSQLiteDataDir',
@@ -173,4 +173,4 @@ class SqliteInstaller extends DatabaseInstaller {
 "# SQLite-specific settings
 \$wgSQLiteDataDir    = \"{$dir}\";";
        }
-}
\ No newline at end of file
+}
index 92c9a00..de49ffe 100644 (file)
@@ -5,15 +5,15 @@
  * @file
  * @ingroup Deployment
  */
+
 /**
  * Class for handling updates to Sqlite databases.
- * 
+ *
  * @ingroup Deployment
  * @since 1.17
  */
 class SqliteUpdater extends DatabaseUpdater {
-       
+
        protected function getCoreUpdateList() {
                return array(
                        // 1.14
index 474b019..eddc0fc 100644 (file)
@@ -103,7 +103,7 @@ class WebInstaller extends CoreInstaller {
 
                // Add parser hook for WebInstaller_Complete
                global $wgParser;
-               $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );               
+               $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );
        }
 
        /**
@@ -598,8 +598,7 @@ class WebInstaller extends CoreInstaller {
                $text = wfMsgReal( $msg, $args, false, false, false );
                $html = htmlspecialchars( $text );
                $html = $this->parse( $text, true );
-               
-               
+
                return "<div class=\"mw-help-field-container\">\n" .
                         "<span class=\"mw-help-field-hint\">" . wfMsgHtml( 'config-help' ) . "</span>\n" .
                         "<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
@@ -921,12 +920,12 @@ class WebInstaller extends CoreInstaller {
        }
 
        public function downloadLinkHook( $text, $attribs, $parser  ) {
-               $img = Html::element( 'img', array( 
+               $img = Html::element( 'img', array(
                        'src' => '../skins/common/images/download-32.png',
                        'width' => '32',
                        'height' => '32',
                ) );
-               $anchor = Html::rawElement( 'a', 
+               $anchor = Html::rawElement( 'a',
                        array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
                        $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
                return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
index 16fe626..54c18f3 100644 (file)
@@ -20,9 +20,9 @@ abstract class WebInstallerPage {
         * @var WebInstaller
         */
        public $parent;
-       
+
        public abstract function execute();
-       
+
        /**
         * Constructor.
         *
@@ -52,17 +52,17 @@ abstract class WebInstallerPage {
        public function endForm( $continue = 'continue', $back = 'back' ) {
                $s = "<div class=\"config-submit\">\n";
                $id = $this->getId();
-               
+
                if ( $id === false ) {
                        $s .= Html::hidden( 'lastPage', $this->parent->request->getVal( 'lastPage' ) );
                }
-               
+
                if ( $continue ) {
                        // Fake submit button for enter keypress (bug 26267)
                        $s .= Xml::submitButton( wfMsg( "config-$continue" ),
                                array( 'name' => "enter-$continue", 'style' => 'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
                }
-               
+
                if ( $back ) {
                        $s .= Xml::submitButton( wfMsg( "config-$back" ),
                                array(
@@ -70,7 +70,7 @@ abstract class WebInstallerPage {
                                        'tabindex' => $this->parent->nextTabIndex()
                                ) ) . "\n";
                }
-               
+
                if ( $continue ) {
                        $s .= Xml::submitButton( wfMsg( "config-$continue" ),
                                array(
@@ -78,7 +78,7 @@ abstract class WebInstallerPage {
                                        'tabindex' => $this->parent->nextTabIndex(),
                                ) ) . "\n";
                }
-               
+
                $s .= "</div></form></div>\n";
                $this->addHTML( $s );
        }
@@ -117,7 +117,7 @@ abstract class WebInstallerPage {
 }
 
 class WebInstaller_Language extends WebInstallerPage {
-       
+
        public function execute() {
                global $wgLang;
                $r = $this->parent->request;
@@ -192,7 +192,7 @@ class WebInstaller_Language extends WebInstallerPage {
                $s .= "\n</select>\n";
                return $this->parent->label( $label, $name, $s );
        }
-       
+
 }
 
 class WebInstaller_ExistingWiki extends WebInstallerPage {
@@ -206,7 +206,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                // Check if the upgrade key supplied to the user has appeared in LocalSettings.php
                if ( $vars['wgUpgradeKey'] !== false
                        && $this->getVar( '_UpgradeKeySupplied' )
-                       && $this->getVar( 'wgUpgradeKey' ) === $vars['wgUpgradeKey'] ) 
+                       && $this->getVar( 'wgUpgradeKey' ) === $vars['wgUpgradeKey'] )
                {
                        // It's there, so the user is authorized
                        $status = $this->handleExistingUpgrade( $vars );
@@ -228,8 +228,8 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                                $this->setVar( '_UpgradeKeySupplied', true );
                        }
                        $this->startForm();
-                       $this->addHTML( $this->parent->getInfoBox( 
-                               wfMsgNoTrans( 'config-upgrade-key-missing', 
+                       $this->addHTML( $this->parent->getInfoBox(
+                               wfMsgNoTrans( 'config-upgrade-key-missing',
                                        "<pre>\$wgUpgradeKey = '" . $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )
                        ) );
                        $this->endForm( 'continue' );
@@ -237,7 +237,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                }
 
                // If there is an upgrade key, but it wasn't supplied, prompt the user to enter it
-                       
+
                $r = $this->parent->request;
                if ( $r->wasPosted() ) {
                        $key = $r->getText( 'config_wgUpgradeKey' );
@@ -266,7 +266,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
         */
        protected function showKeyForm() {
                $this->startForm();
-               $this->addHTML( 
+               $this->addHTML(
                        $this->parent->getInfoBox( wfMsgNoTrans( 'config-localsettings-upgrade' ) ).
                        '<br />' .
                        $this->parent->getTextBox( array(
@@ -324,7 +324,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                $status = $installer->getConnection();
                if ( !$status->isOK() ) {
                        // Adjust the error message to explain things correctly
-                       $status->replaceMessage( 'config-connection-error', 
+                       $status->replaceMessage( 'config-connection-error',
                                'config-localsettings-connection-error' );
                        return $status;
                }
@@ -336,7 +336,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
 }
 
 class WebInstaller_Welcome extends WebInstallerPage {
-       
+
        public function execute() {
                if ( $this->parent->request->wasPosted() ) {
                        if ( $this->getVar( '_Environment' ) ) {
@@ -352,11 +352,11 @@ class WebInstaller_Welcome extends WebInstallerPage {
                        $this->endForm();
                }
        }
-       
+
 }
 
 class WebInstaller_DBConnect extends WebInstallerPage {
-       
+
        public function execute() {
                if ( $this->getVar( '_ExistingDBSettings' ) ) {
                        return 'skip';
@@ -428,11 +428,11 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                }
                return $installer->submitConnectForm();
        }
-       
+
 }
 
 class WebInstaller_Upgrade extends WebInstallerPage {
-       
+
        public function execute() {
                if ( $this->getVar( '_UpgradeDone' ) ) {
                        // Allow regeneration of LocalSettings.php, unless we are working 
@@ -505,11 +505,11 @@ class WebInstaller_Upgrade extends WebInstallerPage {
                $this->parent->restoreLinkPopups();
                $this->endForm( $regenerate ? 'regenerate' : false, false );
        }
-       
+
 }
 
 class WebInstaller_DBSettings extends WebInstallerPage {
-       
+
        public function execute() {
                $installer = $this->parent->getDBInstaller( $this->getVar( 'wgDBtype' ) );
 
@@ -538,7 +538,7 @@ class WebInstaller_DBSettings extends WebInstallerPage {
 }
 
 class WebInstaller_Name extends WebInstallerPage {
-       
+
        public function execute() {
                $r = $this->parent->request;
                if ( $r->wasPosted() ) {
@@ -576,7 +576,7 @@ class WebInstaller_Name extends WebInstallerPage {
                                'var' => 'wgMetaNamespace',
                                'label' => '', //TODO: Needs a label?
                                'attribs' => array( 'readonly' => 'readonly', 'class' => 'enabledByOther' ),
-                           
+
                        ) ) .
                        $this->getFieldSetStart( 'config-admin-box' ) .
                        $this->parent->getTextBox( array(
@@ -706,11 +706,11 @@ class WebInstaller_Name extends WebInstallerPage {
                }
                return $retVal;
        }
-       
+
 }
 
 class WebInstaller_Options extends WebInstallerPage {
-       
+
        public function execute() {
                if ( $this->getVar( '_SkipOptional' ) == 'skip' ) {
                        return 'skip';
@@ -985,7 +985,7 @@ class WebInstaller_Options extends WebInstallerPage {
                $this->parent->setVar( '_Extensions', $extsToInstall );
                return true;
        }
-       
+
 }
 
 class WebInstaller_Install extends WebInstallerPage {
@@ -1028,11 +1028,11 @@ class WebInstaller_Install extends WebInstallerPage {
                        $this->parent->showStatusBox( $status );
                }
        }
-       
+
 }
 
 class WebInstaller_Complete extends WebInstallerPage {
-       
+
        public function execute() {
                // Pop up a dialog box, to make it difficult for the user to forget 
                // to download the file
@@ -1058,7 +1058,7 @@ class WebInstaller_Complete extends WebInstallerPage {
 }
 
 class WebInstaller_Restart extends WebInstallerPage {
-       
+
        public function execute() {
                $r = $this->parent->request;
                if ( $r->wasPosted() ) {
@@ -1076,11 +1076,11 @@ class WebInstaller_Restart extends WebInstallerPage {
                $this->addHTML( $s );
                $this->endForm( 'restart' );
        }
-       
+
 }
 
 abstract class WebInstaller_Document extends WebInstallerPage {
-       
+
        protected abstract function getFileName();
 
        public  function execute() {
@@ -1123,7 +1123,7 @@ abstract class WebInstaller_Document extends WebInstallerPage {
                return '<span class="config-plainlink">[http://www.mediawiki.org/wiki/Manual:' .
                        $matches[1] . ' ' . $matches[1] . ']</span>';
        }
-       
+
 }
 
 class WebInstaller_Readme extends WebInstaller_Document {