35 if ( $vars[
'wgUpgradeKey'] !==
false
36 && $this->
getVar(
'_UpgradeKeySupplied' )
37 && $this->
getVar(
'wgUpgradeKey' ) === $vars[
'wgUpgradeKey']
41 if ( $status->isOK() ) {
45 $this->parent->showStatusBox( $status );
53 if ( $vars[
'wgUpgradeKey'] ===
false ) {
54 if ( $this->
getVar(
'wgUpgradeKey',
false ) ===
false ) {
55 $secretKey = $this->
getVar(
'wgSecretKey' );
56 $this->parent->generateKeys();
57 $this->
setVar(
'wgSecretKey', $secretKey );
58 $this->
setVar(
'_UpgradeKeySupplied',
true );
61 $this->
addHTML( $this->parent->getInfoBox(
62 wfMessage(
'config-upgrade-key-missing',
"<pre dir=\"ltr\">\$wgUpgradeKey = '" .
63 $this->
getVar(
'wgUpgradeKey' ) .
"';</pre>" )->plain()
72 $r = $this->parent->request;
73 if ( $r->wasPosted() ) {
74 $key = $r->getText(
'config_wgUpgradeKey' );
75 if ( !$key || $key !== $vars[
'wgUpgradeKey'] ) {
76 $this->parent->showError(
'config-localsettings-badkey' );
83 if ( $status->isOK() ) {
86 $this->parent->showStatusBox( $status );
104 $this->parent->getInfoBox(
wfMessage(
'config-localsettings-upgrade' )->plain() ) .
106 $this->parent->getTextBox( [
107 'var' =>
'wgUpgradeKey',
108 'label' =>
'config-localsettings-key',
109 'attribs' => [
'autocomplete' =>
'off' ],
123 foreach ( $names as $name ) {
124 if ( !isset( $vars[$name] ) ) {
125 $status->fatal(
'config-localsettings-incomplete', $name );
127 $this->
setVar( $name, $vars[$name] );
142 if ( !isset( $vars[
'wgDBtype'] ) ||
149 $requiredVars = [
'wgDBtype' ];
151 $installer = $this->parent->getDBInstaller();
152 $status->merge( $this->
importVariables( $installer->getGlobalNames(), $vars ) );
153 if ( !$status->isOK() ) {
157 $this->
setVar(
'_InstallUser', $vars[
'wgDBadminuser'] ?? $vars[
'wgDBuser'] );
158 $this->
setVar(
'_InstallPassword', $vars[
'wgDBadminpassword'] ?? $vars[
'wgDBpassword'] );
161 $status = $installer->getConnection();
162 if ( !$status->isOK() ) {
164 $status->replaceMessage(
'config-connection-error',
165 'config-localsettings-connection-error' );
171 $this->
setVar(
'_ExistingDBSettings',
true );
174 $this->
setVar(
'wgAuthenticationTokenVersion',
175 $vars[
'wgAuthenticationTokenVersion'] ??
null
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
static getExistingLocalSettings()
Determine if LocalSettings.php exists.
static getDBTypes()
Get a list of known DB types.
static newFatal( $message,... $parameters)
Factory function for fatal errors.
static newGood( $value=null)
Factory function for good results.
importVariables( $names, $vars)
handleExistingUpgrade( $vars)
Initiate an upgrade of the existing database.
showKeyForm()
Show the "enter key" form.
Abstract class to define pages for the web installer.
endForm( $continue='continue', $back='back')
getVar( $var, $default=null)