Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -417,8 +417,9 @@ |
418 | 418 | 'config-extensions-help' => 'The extensions listed above were detected in your <code>./extensions</code> directory. |
419 | 419 | |
420 | 420 | They may require additional configuration, but you can enable them now', |
421 | | - 'config-install-step-done' => 'Done', |
422 | | - 'config-install-step-failed' => 'Failed', |
| 421 | + 'config-install-alreadydone' => "'''Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", |
| 422 | + 'config-install-step-done' => 'done', |
| 423 | + 'config-install-step-failed' => 'failed', |
423 | 424 | 'config-install-extensions' => 'Including extensions', |
424 | 425 | 'config-install-database' => 'Setting up database', |
425 | 426 | 'config-install-pg-schema-failed' => 'Tables creation failed. |
— | — | @@ -426,8 +427,11 @@ |
427 | 428 | 'config-install-user' => 'Creating database user', |
428 | 429 | 'config-install-user-failed' => 'Granting permission to user "$1" failed: $2', |
429 | 430 | 'config-install-tables' => 'Creating tables', |
| 431 | + 'config-install-tables-exist' => "'''Warning''': MediaWiki tables seem to already exist. Skipping creation", |
| 432 | + 'config-install-tables-failed' => "'''Error''': Table creation failed with the following error $1", |
430 | 433 | 'config-install-interwiki' => 'Populating default interwiki table', |
431 | 434 | 'config-install-interwiki-sql' => 'Could not find file <code>interwiki.sql</code>', |
| 435 | + 'config-install-interwiki-exists' => "'''Warning''': Interwiki table seems to already have entires. Skipping default list", |
432 | 436 | 'config-install-secretkey' => 'Generating secret key', |
433 | 437 | 'config-insecure-secretkey' => "'''Warning:''' Unable to create secure <code>\$wgSecretKey</code>. |
434 | 438 | Consider changing it manually.", |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -1579,16 +1579,24 @@ |
1580 | 1580 | function execute() { |
1581 | 1581 | if( $this->parent->request->wasPosted() ) { |
1582 | 1582 | return 'continue'; |
| 1583 | + } elseif( $this->getVar( '_InstallDone' ) ) { |
| 1584 | + $this->startForm(); |
| 1585 | + $status = new Status(); |
| 1586 | + $status->warning( 'config-install-alreadydone' ); |
| 1587 | + $this->parent->showStatusBox( $status ); |
| 1588 | + $this->endForm(); |
| 1589 | + return true; |
| 1590 | + } else { |
| 1591 | + $this->startForm(); |
| 1592 | + $this->addHTML("<ul>"); |
| 1593 | + $this->parent->performInstallation( |
| 1594 | + array( $this, 'startStage'), |
| 1595 | + array( $this, 'endStage' ) |
| 1596 | + ); |
| 1597 | + $this->addHTML("</ul>"); |
| 1598 | + $this->endForm(); |
| 1599 | + return true; |
1583 | 1600 | } |
1584 | | - $this->startForm(); |
1585 | | - $this->addHTML("<ul>"); |
1586 | | - $this->parent->performInstallation( |
1587 | | - array( $this, 'startStage'), |
1588 | | - array( $this, 'endStage' ) |
1589 | | - ); |
1590 | | - $this->addHTML("</ul>"); |
1591 | | - $this->endForm(); |
1592 | | - return true; |
1593 | 1601 | |
1594 | 1602 | } |
1595 | 1603 | |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -51,6 +51,7 @@ |
52 | 52 | '_SafeMode' => false, |
53 | 53 | '_RaiseMemory' => false, |
54 | 54 | '_UpgradeDone' => false, |
| 55 | + '_InstallDone' => false, |
55 | 56 | '_Caches' => array(), |
56 | 57 | '_InstallUser' => 'root', |
57 | 58 | '_InstallPassword' => '', |
— | — | @@ -887,6 +888,7 @@ |
888 | 889 | if( !$status->isOk() ) |
889 | 890 | break; |
890 | 891 | } |
| 892 | + $this->setVar( '_InstallDone', true ); |
891 | 893 | return $installResults; |
892 | 894 | } |
893 | 895 | |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -406,7 +406,7 @@ |
407 | 407 | $db = $this->getVar( 'wgDBname' ); |
408 | 408 | $this->db->selectDB( $db ); |
409 | 409 | $error = $this->db->sourceFile( "$IP/maintenance/users.sql" ); |
410 | | - if ( !$error ) { |
| 410 | + if ( $error !== true ) { |
411 | 411 | $status->fatal( 'config-install-user-failed', $this->getVar( 'wgDBuser' ), $error ); |
412 | 412 | } |
413 | 413 | |
— | — | @@ -420,10 +420,17 @@ |
421 | 421 | return $status; |
422 | 422 | } |
423 | 423 | $this->db->selectDB( $this->getVar( 'wgDBname' ) ); |
424 | | - if ( !$this->db->sourceFile( "$IP/maintenance/tables.sql" ) ) { |
425 | | - //@todo |
| 424 | + |
| 425 | + if( $this->db->tableExists( 'user' ) ) { |
| 426 | + $status->warning( 'config-install-tables-exist' ); |
| 427 | + return $status; |
| 428 | + } |
| 429 | + |
| 430 | + $error = $this->db->sourceFile( "$IP/maintenance/tables.sql" ); |
| 431 | + if( $error !== true ) { |
| 432 | + $status->fatal( 'config-install-tables-failed', $error ); |
426 | 433 | } |
427 | | - return Status::newGood(); |
| 434 | + return $status; |
428 | 435 | } |
429 | 436 | |
430 | 437 | function getTableOptions() { |
Index: trunk/phase3/includes/installer/InstallerDBType.php |
— | — | @@ -349,6 +349,11 @@ |
350 | 350 | return $status; |
351 | 351 | } |
352 | 352 | $this->db->selectDB( $this->getVar( 'wgDBname' ) ); |
| 353 | + |
| 354 | + if( $this->db->selectRow( 'interwiki', '*', array(), __METHOD__ ) ) { |
| 355 | + $status->warning( 'config-install-interwiki-exists' ); |
| 356 | + return $status; |
| 357 | + } |
353 | 358 | global $IP; |
354 | 359 | $rows = file( "$IP/maintenance/interwiki.list", |
355 | 360 | FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ); |