r66364 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66363‎ | r66364 | r66365 >
Date:17:41, 13 May 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
(bug 22844) Support Micosoft Windows Cache aka WINCACHE
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/BagOStuff.php (modified) (history)
  • /trunk/phase3/includes/ObjectCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/BagOStuff.php
@@ -735,3 +735,60 @@
736736 return $result;
737737 }
738738 }
 739+
 740+/**
 741+ * Wrapper for WinCache object caching functions; identical interface
 742+ * to the APC wrapper
 743+ *
 744+ * @ingroup Cache
 745+ */
 746+class WinCacheBagOStuff extends BagOStuff {
 747+
 748+ /**
 749+ * Get a value from the WinCache object cache
 750+ *
 751+ * @param $key String: cache key
 752+ * @return mixed
 753+ */
 754+ public function get( $key ) {
 755+ $val = wincache_ucache_get( $key );
 756+ if ( is_string( $val ) )
 757+ $val = unserialize( $val );
 758+ return $val;
 759+ }
 760+
 761+ /**
 762+ * Store a value in the WinCache object cache
 763+ *
 764+ * @param $key String: cache key
 765+ * @param $value Mixed: object to store
 766+ * @param $expire Int: expiration time
 767+ * @return bool
 768+ */
 769+ public function set( $key, $value, $expire = 0 ) {
 770+ wincache_ucache_set( $key, serialize( $value ), $expire );
 771+ return true;
 772+ }
 773+
 774+ /**
 775+ * Remove a value from the WinCache object cache
 776+ *
 777+ * @param $key String: cache key
 778+ * @param $time Int: not used in this implementation
 779+ * @return bool
 780+ */
 781+ public function delete( $key, $time = 0 ) {
 782+ wincache_ucache_delete( $key );
 783+ return true;
 784+ }
 785+
 786+ public function keys() {
 787+ $info = wincache_ucache_info();
 788+ $list = $info['ucache_entries'];
 789+ $keys = array();
 790+ foreach ( $list as $entry ) {
 791+ $keys[] = $entry['key_name'];
 792+ }
 793+ return $keys;
 794+ }
 795+}
Index: trunk/phase3/includes/ObjectCache.php
@@ -66,6 +66,8 @@
6767 $wgCaches[CACHE_ACCEL] = new APCBagOStuff;
6868 } elseif( function_exists( 'xcache_get' ) ) {
6969 $wgCaches[CACHE_ACCEL] = new XCacheBagOStuff();
 70+ } elseif( function_exists( 'wincache_ucache_get' ) ) {
 71+ $wgCaches[CACHE_ACCEL] = new WinCacheBagOStuff();
7072 } else {
7173 $wgCaches[CACHE_ACCEL] = false;
7274 }
Index: trunk/phase3/includes/AutoLoader.php
@@ -254,6 +254,7 @@
255255 'WikiMap' => 'includes/WikiMap.php',
256256 'WikiReference' => 'includes/WikiMap.php',
257257 'WikiXmlError' => 'includes/WikiError.php',
 258+ 'WinCacheBagOStuff' => 'includes/BagOStuff.php',
258259 'XCacheBagOStuff' => 'includes/BagOStuff.php',
259260 'XmlDumpWriter' => 'includes/Export.php',
260261 'Xml' => 'includes/Xml.php',
Index: trunk/phase3/RELEASE-NOTES
@@ -72,6 +72,7 @@
7373 is no title match in search and the user has no rights to create pages.
7474 * (bug 23429) Added new hook WatchlistEditorBuildRemoveLine
7575 * (bug 18488) Added maintenance script refreshCategoryCounts.php
 76+* (bug 22844) Added support for WinCache object caching
7677
7778 === Bug fixes in 1.17 ===
7879 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r66366Credits for r66364maxsem17:58, 13 May 2010
r66369Followup r66364, add WinCache support to installerdemon18:07, 13 May 2010
r78322Follow-up r66364: wincache fixes...btongminh20:04, 13 December 2010

Comments

#Comment by Bryan (talk | contribs)   19:45, 12 December 2010

Installed it and it makes MediaWiki amazingly fast on IIS :)

#Comment by 😂 (talk | contribs)   13:00, 13 December 2010

Yay for IIS people using Mediawiki! (all 3 of you :p)

#Comment by Bryan (talk | contribs)   13:14, 13 December 2010

I count 2, who is the 3rd?

#Comment by 😂 (talk | contribs)   13:40, 13 December 2010

I was giving you the benefit of the doubt ;-)

Status & tagging log