Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -739,7 +739,7 @@ |
740 | 740 | $this->output->addHTML( $this->getErrorBox( $text ) ); |
741 | 741 | } |
742 | 742 | |
743 | | - function showStatusError( $status ) { |
| 743 | + function showStatusMessage( $status ) { |
744 | 744 | $text = $status->getWikiText(); |
745 | 745 | $this->output->addWikiText( |
746 | 746 | "<div class=\"config-message\">\n" . |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -260,7 +260,7 @@ |
261 | 261 | */ |
262 | 262 | abstract function showMessage( $msg /*, ... */ ); |
263 | 263 | |
264 | | - abstract function showStatusError( $status ); |
| 264 | + abstract function showStatusMessage( $status ); |
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Get a list of known DB types |
— | — | @@ -869,7 +869,7 @@ |
870 | 870 | public function installTables() { |
871 | 871 | $installer = $this->getDBInstaller(); |
872 | 872 | $status = $installer->createTables(); |
873 | | - if( $status->isGood() ) { |
| 873 | + if( $status->isOK() ) { |
874 | 874 | LBFactory::enableBackend(); |
875 | 875 | } |
876 | 876 | return $status; |
— | — | @@ -888,6 +888,9 @@ |
889 | 889 | $file = fopen( "/dev/urandom", "r" ); |
890 | 890 | wfRestoreWarnings(); |
891 | 891 | } |
| 892 | + |
| 893 | + $status = Status::newGood(); |
| 894 | + |
892 | 895 | if ( $file ) { |
893 | 896 | $secretKey = bin2hex( fread( $file, 32 ) ); |
894 | 897 | fclose( $file ); |
— | — | @@ -896,10 +899,11 @@ |
897 | 900 | for ( $i=0; $i<8; $i++ ) { |
898 | 901 | $secretKey .= dechex(mt_rand(0, 0x7fffffff)); |
899 | 902 | } |
900 | | - $this->output->addWarningMsg( 'config-insecure-secretkey' ); |
| 903 | + $status->warning( 'config-insecure-secretkey' ); |
901 | 904 | } |
902 | 905 | $this->setVar( 'wgSecretKey', $secretKey ); |
903 | | - return Status::newGood(); |
| 906 | + |
| 907 | + return $status; |
904 | 908 | } |
905 | 909 | |
906 | 910 | public function installSysop() { |
Index: trunk/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -158,31 +158,27 @@ |
159 | 159 | //@todo or...? |
160 | 160 | $this->db->reportQueryError( $err, 0, $sql, __FUNCTION__ ); |
161 | 161 | } |
162 | | - $this->setupSearchIndex(); |
163 | | - // Create default interwikis |
164 | | - return Status::newGood(); |
| 162 | + return $this->setupSearchIndex(); |
165 | 163 | } |
166 | 164 | |
167 | 165 | function setupSearchIndex() { |
168 | 166 | global $IP; |
169 | 167 | |
| 168 | + $status = Status::newGood(); |
| 169 | + |
170 | 170 | $module = $this->db->getFulltextSearchModule(); |
171 | 171 | $fts3tTable = $this->db->checkForEnabledSearch(); |
172 | 172 | if ( $fts3tTable && !$module ) { |
173 | | - $this->parent->output->addHtml |
174 | | - ( wfMsgHtml( 'word-separator' ) . wfMsgHtml( 'config-sqlite-fts3-downgrade' ) . wfMsgHtml( 'ellipsis' ) ); |
175 | | - $this->parent->output->flush(); |
| 173 | + $status->warning( 'config-sqlite-fts3-downgrade' ); |
176 | 174 | $this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-no-fts.sql" ); |
177 | 175 | } elseif ( !$fts3tTable && $module == 'FTS3' ) { |
178 | | - $this->parent->output->addHtml |
179 | | - ( wfMsgHtml( 'word-separator' ) . wfMsgHtml( 'config-sqlite-fts3-add' ) . wfMsg( 'ellipsis' ) ); |
180 | | - $this->parent->output->flush(); |
| 176 | + $status->warning( 'config-sqlite-fts3-add' ); |
181 | 177 | $this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-fts3.sql" ); |
182 | 178 | } else { |
183 | | - $this->parent->output->addHtml |
184 | | - ( wfMsgHtml( 'word-separator' ) . wfMsgHtml( 'config-sqlite-fts3-ok' ) . wfMsgHtml( 'ellipsis' ) ); |
185 | | - $this->parent->output->flush(); |
| 179 | + $status->warning( 'config-sqlite-fts3-ok' ); |
186 | 180 | } |
| 181 | + |
| 182 | + return $status; |
187 | 183 | } |
188 | 184 | |
189 | 185 | function doUpgrade() { |
Index: trunk/phase3/includes/installer/CliInstaller.php |
— | — | @@ -62,8 +62,6 @@ |
63 | 63 | if ( isset( $option['pass'] ) ) { |
64 | 64 | $this->setVar( '_AdminPassword', $option['pass'] ); |
65 | 65 | } |
66 | | - |
67 | | - $this->output = new CliInstallerOutput( $this ); |
68 | 66 | } |
69 | 67 | |
70 | 68 | /** |
— | — | @@ -74,22 +72,23 @@ |
75 | 73 | $this->showMessage("Installing $step... "); |
76 | 74 | $func = 'install' . ucfirst( $step ); |
77 | 75 | $status = $this->{$func}(); |
78 | | - $ok = $status->isGood(); |
79 | | - if ( !$ok ) { |
80 | | - $this->showStatusError( $status ); |
| 76 | + if ( !$status->isOk() ) { |
| 77 | + $this->showStatusMessage( $status ); |
81 | 78 | exit; |
| 79 | + } elseif ( !$status->isGood() ) { |
| 80 | + $this->showStatusMessage( $status ); |
82 | 81 | } |
83 | 82 | $this->showMessage("done\n"); |
84 | 83 | } |
85 | 84 | } |
86 | 85 | |
87 | 86 | function showMessage( $msg /*, ... */ ) { |
88 | | - $this->output->addHTML($msg); |
89 | | - $this->output->output(); |
| 87 | + echo html_entity_decode( strip_tags( $msg ), ENT_QUOTES ); |
| 88 | + flush(); |
90 | 89 | } |
91 | 90 | |
92 | | - function showStatusError( $status ) { |
93 | | - $this->output->addHTML($status->getWikiText()."\n"); |
94 | | - $this->output->flush(); |
| 91 | + function showStatusMessage( $status ) { |
| 92 | + $this->showMessage( $status->getWikiText() ); |
95 | 93 | } |
| 94 | + |
96 | 95 | } |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -414,7 +414,6 @@ |
415 | 415 | |
416 | 416 | # includes/installer |
417 | 417 | 'CliInstaller' => 'includes/installer/CliInstaller.php', |
418 | | - 'CliInstallerOutput' => 'includes/installer/CliInstallerOutput.php', |
419 | 418 | 'Installer' => 'includes/installer/Installer.php', |
420 | 419 | 'InstallerDBType' => 'includes/installer/InstallerDBType.php', |
421 | 420 | 'LBFactory_InstallerFake' => 'includes/installer/Installer.php', |