'config-insecure-secretkey' => "'''Warning:''' Unable to create secure <code>\$wgSecretKey</code>.
Consider changing it manually.",
'config-install-sysop' => 'Creating administrator user account',
- 'config-install-localsettings' => 'Creating LocalSettings.php',
- 'config-install-localsettings-unwritable' => 'Warning: Could not write <code>LocalSettings.php</code>.
-Create it yourself, using the following text:
-<textarea name="LocalSettings" id="LocalSettings" cols="80" rows="25" readonly="readonly">
-$1
-</textarea>
-',
'config-install-done' => "'''Congratulations!'''
You have successfully installed MediaWiki.
We have generated a <code>LocalSettings.php</code> file for you. It contains all your configuration.
-You will need to move it from <code>./config/LocalSettings.php</code> to <code>./LocalSettings.php</code> in order for MediaWiki to work:
-
-On a Unix/Linux system:
-
-<pre>
-mv ./config/LocalSettings.php ./LocalSettings.php
-</pre>
-
-When that's done, you can [$1 '''enter your wiki''']",
- 'config-install-done-moved' => "'''Congratulations!'''
-You have successfully installed MediaWiki.
+You will need to [$1 download] it and put it in the base of your wiki installation (the same directory as index.php)
-[$1 Enter your wiki]",
+When that's done, you can [$2 '''enter your wiki''']", // $1 is the URL to LocalSettings download, $2 is link to wiki
);
/** Dutch (Nederlands)
'interwiki',
'secretkey',
'sysop',
- 'localsettings',
);
/**
if( !$status->isOk() )
break;
}
- $this->setVar( '_InstallDone', true );
+ if( $status->isOk() ) {
+ $this->setVar( '_InstallDone', true );
+ }
return $installResults;
}
return Status::newGood();
}
- public function installLocalsettings() {
- $localSettings = new LocalSettingsGenerator( $this );
- return $localSettings->writeLocalSettings();
- }
-
/**
* Determine if LocalSettings exists. If it does, return an appropriate
* status for whether we should can upgrade or not
return $localSettings;
}
- /**
- * Write the file
- * @param $secretKey String A random string to
- * @return boolean On successful file write
- */
- public function writeLocalSettings() {
- $localSettings = $this->getText();
- wfSuppressWarnings();
- $ret = file_put_contents( $this->configPath . '/LocalSettings.php', $localSettings );
- wfRestoreWarnings();
-
- $status = Status::newGood();
-
- if ( !$ret ) {
- $status->fatal( 'config-install-localsettings-unwritable', $localSettings );
- }
-
- return $status;
- }
-
private function buildMemcachedServerList() {
$servers = $this->values['_MemCachedServers'];
if( !$servers ) {
$this->exportVars();
$this->setupLanguage();
+ if( $this->getVar( '_InstallDone' ) && $this->request->getVal( 'localsettings' ) )
+ {
+ $ls = new LocalSettingsGenerator( $this );
+ $this->request->response()->header('Content-type: text/plain');
+ $this->request->response()->header(
+ 'Content-Disposition: attachment; filename="LocalSettings.php"'
+ );
+ echo $ls->getText();
+ return $this->session;
+ }
+
if ( isset( $session['happyPages'] ) ) {
$this->happyPages = $session['happyPages'];
} else {
public function execute() {
global $IP;
$this->startForm();
- $msg = file_exists( "$IP/LocalSettings.php" ) ? 'config-install-done-moved' : 'config-install-done';
$this->addHTML(
$this->parent->getInfoBox(
- wfMsgNoTrans( $msg,
+ wfMsgNoTrans( 'config-install-done',
+ $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) ),
$GLOBALS['wgServer'] .
$this->getVar( 'wgScriptPath' ) . '/index' .
$this->getVar( 'wgScriptExtension' )