MediaWiki r63389 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r63388‎ | r63389 (on ViewVC)‎ | r63390 >
Date:14:10, 8 March 2010
Author:demon
Status:deferred (Comments)
Tags:
Comment:
Add object cache settings to advanced setup. Still needs Memcached servers text field
Modified paths:

Diff [purge]

Index: branches/new-installer/phase3/maintenance/language/messages.inc
===================================================================
--- branches/new-installer/phase3/maintenance/language/messages.inc	(revision 63388)
+++ branches/new-installer/phase3/maintenance/language/messages.inc	(revision 63389)
@@ -3332,6 +3332,13 @@
 		'config-cc-again',
 		'config-cc-not-chosen',
 		'config-advanced-settings',
+		'config-cache-settings',
+		'config-cache-help',
+		'config-cache-none',
+		'config-cache-accel',
+		'config-cache-memcached',
+		'config-cache-db',
+		'config-cache-anything',
 		'config-extensions',
 		'config-extensions-help',
 		'config-stage-done',
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
===================================================================
--- branches/new-installer/phase3/includes/installer/WebInstaller.php	(revision 63388)
+++ branches/new-installer/phase3/includes/installer/WebInstaller.php	(revision 63389)
@@ -1299,10 +1299,26 @@
 				'label' => 'config-logo'
 			) ) .
 			$this->parent->getHelpBox( 'config-logo-help' ) .
-			$this->parent->getFieldsetEnd() .
+			$this->parent->getFieldsetEnd()
+		);
 
+		$caches = array( 'none', 'anything', 'db' );
+		if( count( $this->getVar( '_Caches' ) ) ) {
+			$caches[] = 'accel';
+		}
+		$caches[] = 'memcached';
+
+		$this->parent->output->addHTML(
 			# Advanced settings
 			$this->parent->getFieldsetStart( 'config-advanced-settings' ) .
+			# Object cache settings
+			$this->parent->getRadioSet( array(
+				'var' => 'wgMainCacheType',
+				'label' => 'config-cache-options',
+				'itemLabelPrefix' => 'config-cache-',
+				'values' => $caches,
+			) ) .
+			$this->parent->getHelpBox( 'config-cache-help' ) .
 			$this->parent->getFieldsetEnd() .
 
 			"<script type=\"text/javascript\">$licenseJs $emailJs $uploadJs</script>\n"
@@ -1397,7 +1413,7 @@
 		$this->parent->setVarsFromRequest( array( '_RightsProfile', '_LicenseCode', 
 			'wgEnableEmail', 'wgPasswordSender', 'wgEnableUpload', 'wgLogo',
 			'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
-			'wgEmailAuthentication') );
+			'wgEmailAuthentication', 'wgMainCacheType' ) );
 
 		if ( !in_array( $this->getVar( '_RightsProfile' ), 
 			array_keys( $this->parent->rightsProfiles ) ) ) 
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php
===================================================================
--- branches/new-installer/phase3/languages/messages/MessagesEn.php	(revision 63388)
+++ branches/new-installer/phase3/languages/messages/MessagesEn.php	(revision 63389)
@@ -4423,6 +4423,14 @@
 'config-cc-again' => 'Pick again...',
 'config-cc-not-chosen' => 'Please choose which Creative Commons license you want and click "proceed".',
 'config-advanced-settings' => 'Advanced configuration',
+'config-cache-options' => 'Object cache settings',
+'config-cache-help' => 'Object caching is used to improve the speed of MediaWiki. Medium to large sites
+are highly encouraged to enable this, and small sites will see benefits as well.',
+'config-cache-anything' => 'MediaWiki will attempt to cache anywhere possible, except Memcached',
+'config-cache-db' => 'Cache data in the database',
+'config-cache-accel' => 'PHP object caching (APC, eAccelerator or XCache)',
+'config-cache-memcached' => 'Use Memcached (requires additional setup, and server IP addresses below)',
+'config-cache-none' => 'Use no caching. No functionality is removed, but speed may be impacted',
 
 'config-extensions' => 'Extensions',
 'config-extensions-help' => "The following extensions were automatically detected in your extensions directory.\n

Follow-up revisions

Rev.Commit summaryAuthorDate
r68831Followup r63389: remove useless CACHE_DB and confusing CACHE_ANYTHING from ca...demon13:43, 1 July 2010

Comments

#Comment by Tim Starling (Talk | contribs)   01:09, 30 June 2010

It doesn't really make sense to set $wgMainCacheType to CACHE_DB, that's the reason it wasn't offered as an option to the user in the old installer. $wgMemc is used to store data which can be fetched with only one or two queries from the database, like user rows. It doesn't make sense to enable a cache that is as slow as fetching the source data. The option should just be removed.

The only reason for the existence of CACHE_ANYTHING is to be a default for the parser and message caches, offering it to the user as an option is confusing. The installer can tell which cache type will actually be used, so there's no reason to be so vague in the UI.

I would suggest offering the same options here as in the old installer.

#Comment by ^demon (Talk | contribs)   13:51, 1 July 2010

Removed CACHE_ANYTHING and CACHE_DB in r68831.

I didn't do it (quite) like the old installer because I figured differentiating between PHP caches was confusing at best. Regardless of what you choose wfGetCache() will still prefer eAccelerator -> APC -> XCache -> WinCache.

Status & tagging log

  • 10:00, 3 December 2010 Reedy (Talk | contribs) changed the status of r63389 [removed: new added: deferred]
  • 13:03, 10 August 2010 Reedy (Talk | contribs) changed the status of r63389 [removed: fixme added: new]
  • 01:09, 30 June 2010 Tim Starling (Talk | contribs) changed the status of r63389 [removed: new added: fixme]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox