r99573 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99572‎ | r99573 | r99574 >
Date:21:24, 11 October 2011
Author:mah
Status:ok
Tags:
Comment:
Fix cli install so that db user is created if needed.
Modified paths:
  • /trunk/phase3/includes/installer/CliInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -383,6 +383,10 @@
384384 }
385385
386386 public function preInstall() {
 387+ $createDbAccount = array(
 388+ 'name' => 'user',
 389+ 'callback' => array( $this, 'setupUser' ),
 390+ );
387391 $commitCB = array(
388392 'name' => 'pg-commit',
389393 'callback' => array( $this, 'commitChanges' ),
@@ -395,15 +399,13 @@
396400 'name' => 'schema',
397401 'callback' => array( $this, 'setupSchema' )
398402 );
 403+
 404+ if( $this->getVar( '_CreateDBAccount' ) ) {
 405+ $this->parent->addInstallStep( $createDbAccount, 'database' );
 406+ }
399407 $this->parent->addInstallStep( $commitCB, 'interwiki' );
400408 $this->parent->addInstallStep( $plpgCB, 'database' );
401409 $this->parent->addInstallStep( $schemaCB, 'database' );
402 - if( $this->getVar( '_CreateDBAccount' ) ) {
403 - $this->parent->addInstallStep( array(
404 - 'name' => 'user',
405 - 'callback' => array( $this, 'setupUser' ),
406 - ) );
407 - }
408410 }
409411
410412 function setupDatabase() {
Index: trunk/phase3/includes/installer/CliInstaller.php
@@ -83,6 +83,9 @@
8484 $option['installdbuser'] );
8585 $this->setVar( '_InstallPassword',
8686 $option['installdbpass'] );
 87+
 88+ // Assume that if we're given the installer user, we'll create the account.
 89+ $this->setVar( '_CreateDBAccount', true );
8790 }
8891
8992 if ( isset( $option['pass'] ) ) {

Status & tagging log