r84756 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84755‎ | r84756 | r84757 >
Date:19:06, 25 March 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Partial revert r78593 (adding --upgrade option to install.php). Rather than supporting the added complexity in the installer, just bail and tell them to run update.php, since they obviously have command line access :)
Modified paths:
  • /trunk/phase3/includes/installer/CliInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/maintenance/install.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/install.php
@@ -50,12 +50,8 @@
5151 $this->addOption( 'dbpass', 'The pasword for the DB user for normal operations', false, true );
5252 $this->addOption( 'confpath', "Path to write LocalSettings.php to, default $IP", false, true );
5353 /* $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true ); */
54 - /* $this->addOption( 'dbtsearch2schema', 'The schema for the tsearch2 DB in pg (public)', false, true ); */
5554 /* $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true ); */
5655 $this->addOption( 'env-checks', "Run environment checks only, don't change anything" );
57 - $this->addOption( 'upgrade',
58 - 'Allow the upgrade to continue despite an existing LocalSettings.php', false, true );
59 -
6056 }
6157
6258 public function execute() {
@@ -76,6 +72,13 @@
7773 return;
7874 }
7975 } else {
 76+ $status = $installer->doEnvironmentChecks();
 77+ if( $status->isGood() ) {
 78+ $installer->showMessage( 'config-env-good' );
 79+ } else {
 80+ $installer->showStatusMessage( $status );
 81+ return;
 82+ }
8083 $installer->execute();
8184 $installer->writeConfigurationFile( $this->getOption( 'confpath', $IP ) );
8285 }
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -19,7 +19,7 @@
2020 To upgrade this installation, please enter the value of <code>\$wgUpgradeKey</code> in the box below.
2121 You will find it in LocalSettings.php.",
2222 'config-localsettings-cli-upgrade' => 'A LocalSettings.php file has been detected.
23 -To upgrade this installation, please give the --upgrade=yes option.',
 23+To upgrade this installation, please run update.php instead',
2424 'config-localsettings-key' => 'Upgrade key:',
2525 'config-localsettings-badkey' => 'The key you provided is incorrect.',
2626 'config-upgrade-key-missing' => 'An existing installation of MediaWiki has been detected.
Index: trunk/phase3/includes/installer/CliInstaller.php
@@ -31,9 +31,6 @@
3232 'dbschema' => 'wgDBmwschema',
3333 'dbpath' => 'wgSQLiteDataDir',
3434 'scriptpath' => 'wgScriptPath',
35 - 'upgrade' => 'cliUpgrade', /* As long as it isn't $confItems
36 - * in LocalSettingsGenerator, we
37 - * should be fine. */
3835 );
3936
4037 /**
@@ -91,10 +88,8 @@
9289 * Main entry point.
9390 */
9491 public function execute() {
95 - global $cliUpgrade;
96 -
9792 $vars = $this->getExistingLocalSettings();
98 - if( $vars && ( !isset( $cliUpgrade ) || $cliUpgrade !== "yes" ) ) {
 93+ if( $vars ) {
9994 $this->showStatusMessage(
10095 Status::newFatal( "config-localsettings-cli-upgrade" )
10196 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r85012MFT installer changes: r84755, r84756, r84875, r84881, r84882, r84970, r84976demon14:46, 30 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78593* Add --wikiroot option to CLI installer so the user can give something besid...mah04:55, 19 December 2010

Comments

#Comment by 😂 (talk | contribs)   00:34, 26 March 2011

Forgot to mention in summary, I also made install *also* run env checks, we should never attempt an installation without trying those first.

Status & tagging log