saper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248493

Change subject: Installer: use _MainCacheType form variable
......................................................................

Installer: use _MainCacheType form variable

Do not use "wgMainCacheType" form variable
name that containst values that cannot be
assigned to $wgMainCacheType

Bug: T116375
Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46
---
M includes/installer/Installer.php
M includes/installer/LocalSettingsGenerator.php
M includes/installer/WebInstallerPage.php
M mw-config/config.js
4 files changed, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/248493/1

diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 064bd6d..c46b3c2 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -164,7 +164,6 @@
                'wgRightsIcon',
                'wgRightsText',
                'wgRightsUrl',
-               'wgMainCacheType',
                'wgEnableEmail',
                'wgEnableUserEmail',
                'wgEnotifUserTalk',
diff --git a/includes/installer/LocalSettingsGenerator.php 
b/includes/installer/LocalSettingsGenerator.php
index 5a2dd1a..a1cd3c4 100644
--- a/includes/installer/LocalSettingsGenerator.php
+++ b/includes/installer/LocalSettingsGenerator.php
@@ -62,7 +62,7 @@
                                'wgLanguageCode', 'wgEnableEmail', 
'wgEnableUserEmail', 'wgDiff3',
                                'wgEnotifUserTalk', 'wgEnotifWatchlist', 
'wgEmailAuthentication',
                                'wgDBtype', 'wgSecretKey', 'wgRightsUrl', 
'wgSitename', 'wgRightsIcon',
-                               'wgRightsText', 'wgMainCacheType', 
'wgEnableUploads',
+                               'wgRightsText', '_MainCacheType', 
'wgEnableUploads',
                                'wgMainCacheType', '_MemCachedServers', 
'wgDBserver', 'wgDBuser',
                                'wgDBpassword', 'wgUseInstantCommons', 
'wgUpgradeKey', 'wgDefaultSkin',
                                'wgMetaNamespace', 'wgLogo',
@@ -290,12 +290,12 @@
                        $serverSetting .= "\$wgServer = 
\"{$this->values['wgServer']}\";\n";
                }
 
-               switch ( $this->values['wgMainCacheType'] ) {
+               switch ( $this->values['_MainCacheType'] ) {
                        case 'anything':
                        case 'db':
                        case 'memcached':
                        case 'accel':
-                               $cacheType = 'CACHE_' . strtoupper( 
$this->values['wgMainCacheType'] );
+                               $cacheType = 'CACHE_' . strtoupper( 
$this->values['_MainCacheType'] );
                                break;
                        case 'none':
                        default:
diff --git a/includes/installer/WebInstallerPage.php 
b/includes/installer/WebInstallerPage.php
index 0d11463..191c752 100644
--- a/includes/installer/WebInstallerPage.php
+++ b/includes/installer/WebInstallerPage.php
@@ -1131,7 +1131,7 @@
                $caches[] = 'memcached';
 
                // We'll hide/show this on demand when the value changes, see 
config.js.
-               $cacheval = $this->getVar( 'wgMainCacheType' );
+               $cacheval = $this->getVar( '_MainCacheType' );
                if ( !$cacheval ) {
                        // We need to set a default here; but don't hardcode it
                        // or we lose it every time we reload the page for 
validation
@@ -1147,7 +1147,7 @@
                        // For grep: The following messages are used as the 
item labels:
                        // config-cache-none, config-cache-accel, 
config-cache-memcached
                        $this->parent->getRadioSet( array(
-                               'var' => 'wgMainCacheType',
+                               'var' => '_MainCacheType',
                                'label' => 'config-cache-options',
                                'itemLabelPrefix' => 'config-cache-',
                                'values' => $caches,
@@ -1285,7 +1285,7 @@
                $this->parent->setVarsFromRequest( array( '_RightsProfile', 
'_LicenseCode',
                        'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads', 
'wgLogo',
                        'wgEnableUserEmail', 'wgEnotifUserTalk', 
'wgEnotifWatchlist',
-                       'wgEmailAuthentication', 'wgMainCacheType', 
'_MemCachedServers',
+                       'wgEmailAuthentication', '_MainCacheType', 
'_MemCachedServers',
                        'wgUseInstantCommons', 'wgDefaultSkin' ) );
 
                $retVal = true;
@@ -1351,7 +1351,7 @@
                }
                $this->parent->setVar( '_Extensions', $extsToInstall );
 
-               if ( $this->getVar( 'wgMainCacheType' ) == 'memcached' ) {
+               if ( $this->getVar( '_MainCacheType' ) == 'memcached' ) {
                        $memcServers = explode( "\n", $this->getVar( 
'_MemCachedServers' ) );
                        if ( !$memcServers ) {
                                $this->parent->showError( 
'config-memcache-needservers' );
diff --git a/mw-config/config.js b/mw-config/config.js
index fb637f7..8b2d6e5 100644
--- a/mw-config/config.js
+++ b/mw-config/config.js
@@ -96,9 +96,9 @@
                $( '#config_wgSitename' ).on( 'keyup change', syncText ).each( 
syncText );
 
                // Show/Hide memcached servers when needed
-               $( 'input[name$="config_wgMainCacheType"]' ).change( function 
() {
+               $( 'input[name$="config__MainCacheType"]' ).change( function () 
{
                        var $memc = $( '#config-memcachewrapper' );
-                       if ( $( 'input[name$="config_wgMainCacheType"]:checked' 
).val() === 'memcached' ) {
+                       if ( $( 'input[name$="config__MainCacheType"]:checked' 
).val() === 'memcached' ) {
                                $memc.show( 'slow' );
                        } else {
                                $memc.hide( 'slow' );

-- 
To view, visit https://gerrit.wikimedia.org/r/248493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: saper <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to