Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -430,7 +430,11 @@ |
431 | 431 | 'config-install-sysop' => 'Creating administrator user account', |
432 | 432 | 'config-install-localsettings' => 'Creating LocalSettings.php', |
433 | 433 | 'config-install-localsettings-unwritable' => 'Warning: Could not write <code>LocalSettings.php</code>. |
434 | | -Create it yourself, using the following text:', |
| 434 | +Create it yourself, using the following text: |
| 435 | +<textarea name="LocalSettings" id="LocalSettings" cols="80" rows="25" readonly="readonly"> |
| 436 | +$1 |
| 437 | +</textarea> |
| 438 | +', |
435 | 439 | 'config-install-done' => "'''Congratulations!''' |
436 | 440 | You have successfully installed MediaWiki. |
437 | 441 | |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -908,15 +908,7 @@ |
909 | 909 | |
910 | 910 | public function installLocalsettings() { |
911 | 911 | $localSettings = new LocalSettingsGenerator( $this ); |
912 | | - $ok = $localSettings->writeLocalSettings(); |
913 | | - |
914 | | - # TODO: Make writeLocalSettings() itself not warn, but instead return |
915 | | - # a Status object to us to pass along. |
916 | | - if ( $ok ) { |
917 | | - return Status::newGood(); |
918 | | - } else { |
919 | | - return Status::newFatal(); |
920 | | - } |
| 912 | + return $localSettings->writeLocalSettings(); |
921 | 913 | } |
922 | 914 | |
923 | 915 | /** |
Index: trunk/phase3/includes/installer/LocalSettingsGenerator.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | $this->configPath = $installer->getVar( 'IP' ) . '/config'; |
17 | 17 | $this->extensions = $installer->getVar( '_Extensions' ); |
18 | 18 | $db = $installer->getDBInstaller( $installer->getVar( 'wgDBtype' ) ); |
19 | | - |
| 19 | + |
20 | 20 | $confItems = array_merge( array( 'wgScriptPath', 'wgScriptExtension', |
21 | 21 | 'wgPasswordSender', 'wgImageMagickConvertCommand', 'wgShellLocale', |
22 | 22 | 'wgLanguageCode', 'wgEnableEmail', 'wgEnableUserEmail', 'wgDiff3', |
— | — | @@ -58,11 +58,11 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | | - * Write the file |
63 | | - * @param $secretKey String A random string to |
64 | | - * @return boolean On successful file write |
| 62 | + * Return the full text of the generated LocalSettings.php file, |
| 63 | + * including the extensions |
| 64 | + * @returns String |
65 | 65 | */ |
66 | | - public function writeLocalSettings() { |
| 66 | + public function getText() { |
67 | 67 | $localSettings = $this->getDefaultText(); |
68 | 68 | if( count( $this->extensions ) ) { |
69 | 69 | $localSettings .= "\n# The following extensions were automatically enabled:\n"; |
— | — | @@ -70,18 +70,30 @@ |
71 | 71 | $localSettings .= "require( 'extensions/$ext/$ext.php' );\n"; |
72 | 72 | } |
73 | 73 | } |
| 74 | + |
| 75 | + return $localSettings; |
| 76 | + } |
| 77 | + |
| 78 | + /** |
| 79 | + * Write the file |
| 80 | + * @param $secretKey String A random string to |
| 81 | + * @return boolean On successful file write |
| 82 | + */ |
| 83 | + public function writeLocalSettings() { |
| 84 | + $localSettings = $this->getText(); |
74 | 85 | wfSuppressWarnings(); |
75 | 86 | $ret = file_put_contents( $this->configPath . '/LocalSettings.php', $localSettings ); |
76 | 87 | wfRestoreWarnings(); |
| 88 | + |
| 89 | + $status = Status::newGood(); |
| 90 | + |
77 | 91 | if ( !$ret ) { |
78 | | - $warn = wfMsg( 'config-install-localsettings-unwritable' ) . ' |
79 | | -<textarea name="LocalSettings" id="LocalSettings" cols="80" rows="25" readonly="readonly">' |
80 | | - . htmlspecialchars( $localSettings ) . '</textarea>'; |
81 | | - $this->installer->output->addWarning( $warn ); |
| 92 | + $status->fatal( 'config-install-localsettings-unwritable', $localSettings ); |
82 | 93 | } |
83 | | - return $ret; |
| 94 | + |
| 95 | + return $status; |
84 | 96 | } |
85 | | - |
| 97 | + |
86 | 98 | private function buildMemcachedServerList() { |
87 | 99 | $servers = $this->values['_MemCachedServers']; |
88 | 100 | if( !$servers ) { |
Index: trunk/phase3/includes/installer/CliInstallerOutput.php |
— | — | @@ -45,14 +45,13 @@ |
46 | 46 | |
47 | 47 | function output() { |
48 | 48 | $this->flush(); |
49 | | - $this->outputFooter(); |
50 | 49 | } |
51 | 50 | |
52 | 51 | function useShortHeader( $use = true ) { |
53 | 52 | } |
54 | 53 | |
55 | 54 | function flush() { |
56 | | - echo $this->contents; |
| 55 | + echo html_entity_decode( strip_tags( $this->contents ), ENT_QUOTES ); |
57 | 56 | flush(); |
58 | 57 | $this->contents = ''; |
59 | 58 | } |
— | — | @@ -77,7 +76,4 @@ |
78 | 77 | $this->addHTML( $this->warnings ); |
79 | 78 | $this->warnings = ''; |
80 | 79 | } |
81 | | - |
82 | | - function outputFooter() {} |
83 | | - |
84 | 80 | } |