r63389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63388‎ | r63389 | 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:
  • /branches/new-installer/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /branches/new-installer/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /branches/new-installer/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/maintenance/language/messages.inc
@@ -3332,6 +3332,13 @@
33333333 'config-cc-again',
33343334 'config-cc-not-chosen',
33353335 'config-advanced-settings',
 3336+ 'config-cache-settings',
 3337+ 'config-cache-help',
 3338+ 'config-cache-none',
 3339+ 'config-cache-accel',
 3340+ 'config-cache-memcached',
 3341+ 'config-cache-db',
 3342+ 'config-cache-anything',
33363343 'config-extensions',
33373344 'config-extensions-help',
33383345 'config-stage-done',
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
@@ -1299,10 +1299,26 @@
13001300 'label' => 'config-logo'
13011301 ) ) .
13021302 $this->parent->getHelpBox( 'config-logo-help' ) .
1303 - $this->parent->getFieldsetEnd() .
 1303+ $this->parent->getFieldsetEnd()
 1304+ );
13041305
 1306+ $caches = array( 'none', 'anything', 'db' );
 1307+ if( count( $this->getVar( '_Caches' ) ) ) {
 1308+ $caches[] = 'accel';
 1309+ }
 1310+ $caches[] = 'memcached';
 1311+
 1312+ $this->parent->output->addHTML(
13051313 # Advanced settings
13061314 $this->parent->getFieldsetStart( 'config-advanced-settings' ) .
 1315+ # Object cache settings
 1316+ $this->parent->getRadioSet( array(
 1317+ 'var' => 'wgMainCacheType',
 1318+ 'label' => 'config-cache-options',
 1319+ 'itemLabelPrefix' => 'config-cache-',
 1320+ 'values' => $caches,
 1321+ ) ) .
 1322+ $this->parent->getHelpBox( 'config-cache-help' ) .
13071323 $this->parent->getFieldsetEnd() .
13081324
13091325 "<script type=\"text/javascript\">$licenseJs $emailJs $uploadJs</script>\n"
@@ -1397,7 +1413,7 @@
13981414 $this->parent->setVarsFromRequest( array( '_RightsProfile', '_LicenseCode',
13991415 'wgEnableEmail', 'wgPasswordSender', 'wgEnableUpload', 'wgLogo',
14001416 'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
1401 - 'wgEmailAuthentication') );
 1417+ 'wgEmailAuthentication', 'wgMainCacheType' ) );
14021418
14031419 if ( !in_array( $this->getVar( '_RightsProfile' ),
14041420 array_keys( $this->parent->rightsProfiles ) ) )
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php
@@ -4423,6 +4423,14 @@
44244424 'config-cc-again' => 'Pick again...',
44254425 'config-cc-not-chosen' => 'Please choose which Creative Commons license you want and click "proceed".',
44264426 'config-advanced-settings' => 'Advanced configuration',
 4427+'config-cache-options' => 'Object cache settings',
 4428+'config-cache-help' => 'Object caching is used to improve the speed of MediaWiki. Medium to large sites
 4429+are highly encouraged to enable this, and small sites will see benefits as well.',
 4430+'config-cache-anything' => 'MediaWiki will attempt to cache anywhere possible, except Memcached',
 4431+'config-cache-db' => 'Cache data in the database',
 4432+'config-cache-accel' => 'PHP object caching (APC, eAccelerator or XCache)',
 4433+'config-cache-memcached' => 'Use Memcached (requires additional setup, and server IP addresses below)',
 4434+'config-cache-none' => 'Use no caching. No functionality is removed, but speed may be impacted',
44274435
44284436 'config-extensions' => 'Extensions',
44294437 'config-extensions-help' => "The following extensions were automatically detected in your extensions directory.\n

Follow-up revisions

RevisionCommit 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 😂 (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