Default to CACHE_ACCEL if user skips advanced settings
authorBrian Wolff <bawolff+wn@gmail.com>
Wed, 15 Mar 2017 06:35:53 +0000 (06:35 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Wed, 15 Mar 2017 06:39:45 +0000 (06:39 +0000)
In the event user skips advanced settings in the installer, and
CACHE_ACCEL is available, we should default to it. This is already
the default in the event the user goes to advanced settings
since b3dc2fedc5e35015f9c7

Bug: T160495
Change-Id: Icaa2ca4e8eb63254142e837d2a47b6023a8ea0a2

includes/installer/LocalSettingsGenerator.php

index 697188e..dde4daa 100644 (file)
@@ -65,6 +65,7 @@ class LocalSettingsGenerator {
                                '_MemCachedServers', 'wgDBserver', 'wgDBuser',
                                'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey', 'wgDefaultSkin',
                                'wgMetaNamespace', 'wgLogo', 'wgAuthenticationTokenVersion', 'wgPingback',
+                               '_Caches',
                        ],
                        $db->getGlobalNames()
                );
@@ -293,11 +294,17 @@ class LocalSettingsGenerator {
                        case 'db':
                        case 'memcached':
                        case 'accel':
+                       case 'none':
                                $cacheType = 'CACHE_' . strtoupper( $this->values['_MainCacheType'] );
                                break;
-                       case 'none':
                        default:
-                               $cacheType = 'CACHE_NONE';
+                               // If the user skipped the options page,
+                               // default to CACHE_ACCEL if available
+                               if ( count( $this->values['_Caches'] ) ) {
+                                       $cacheType = 'CACHE_ACCEL';
+                               } else {
+                                       $cacheType = 'CACHE_NONE';
+                               }
                }
 
                $mcservers = $this->buildMemcachedServerList();