40 if ( $vars[
'wgUpgradeKey'] !==
false
41 && $this->
getVar(
'_UpgradeKeySupplied' )
42 && $this->
getVar(
'wgUpgradeKey' ) === $vars[
'wgUpgradeKey']
46 if ( $status->isOK() ) {
50 $this->parent->showStatusBox( $status );
58 if ( $vars[
'wgUpgradeKey'] ===
false ) {
59 if ( $this->
getVar(
'wgUpgradeKey',
false ) ===
false ) {
60 $secretKey = $this->
getVar(
'wgSecretKey' );
61 $this->parent->generateKeys();
62 $this->
setVar(
'wgSecretKey', $secretKey );
63 $this->
setVar(
'_UpgradeKeySupplied',
true );
66 $this->
addHTML( $this->parent->getInfoBox(
67 wfMessage(
'config-upgrade-key-missing',
"<pre dir=\"ltr\">\$wgUpgradeKey = '" .
68 $this->
getVar(
'wgUpgradeKey' ) .
"';</pre>" )->plain()
77 $r = $this->parent->request;
78 if ( $r->wasPosted() ) {
79 $key = $r->getText(
'config_wgUpgradeKey' );
80 if ( !$key || $key !== $vars[
'wgUpgradeKey'] ) {
81 $this->parent->showError(
'config-localsettings-badkey' );
88 if ( $status->isOK() ) {
91 $this->parent->showStatusBox( $status );
109 $this->parent->getInfoBox(
wfMessage(
'config-localsettings-upgrade' )->plain() ) .
111 $this->parent->getTextBox( [
112 'var' =>
'wgUpgradeKey',
113 'label' =>
'config-localsettings-key',
114 'attribs' => [
'autocomplete' =>
'off' ],
127 $status = Status::newGood();
128 foreach ( $names as $name ) {
129 if ( !isset( $vars[$name] ) ) {
130 $status->fatal(
'config-localsettings-incomplete', $name );
132 $this->
setVar( $name, $vars[$name] );
147 if ( !isset( $vars[
'wgDBtype'] ) ||
150 return Status::newFatal(
'config-localsettings-connection-error',
'' );
154 $requiredVars = [
'wgDBtype' ];
156 $installer = $this->parent->getDBInstaller();
157 $status->merge( $this->
importVariables( $installer->getGlobalNames(), $vars ) );
158 if ( !$status->isOK() ) {
162 $this->
setVar(
'_InstallUser', $vars[
'wgDBadminuser'] ?? $vars[
'wgDBuser'] );
163 $this->
setVar(
'_InstallPassword', $vars[
'wgDBadminpassword'] ?? $vars[
'wgDBpassword'] );
166 $status = $installer->getConnection();
167 if ( !$status->isOK() ) {
169 $status->replaceMessage(
'config-connection-error',
170 'config-localsettings-connection-error' );
176 $this->
setVar(
'_ExistingDBSettings',
true );
179 $this->
setVar(
'wgAuthenticationTokenVersion',
180 $vars[
'wgAuthenticationTokenVersion'] ??
null
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Abstract class to define pages for the web installer.
endForm( $continue='continue', $back='back')
getVar( $var, $default=null)