Index: trunk/phase3/includes/BagOStuff.php |
— | — | @@ -735,3 +735,60 @@ |
736 | 736 | return $result; |
737 | 737 | } |
738 | 738 | } |
| 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 @@ |
67 | 67 | $wgCaches[CACHE_ACCEL] = new APCBagOStuff; |
68 | 68 | } elseif( function_exists( 'xcache_get' ) ) { |
69 | 69 | $wgCaches[CACHE_ACCEL] = new XCacheBagOStuff(); |
| 70 | + } elseif( function_exists( 'wincache_ucache_get' ) ) { |
| 71 | + $wgCaches[CACHE_ACCEL] = new WinCacheBagOStuff(); |
70 | 72 | } else { |
71 | 73 | $wgCaches[CACHE_ACCEL] = false; |
72 | 74 | } |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -254,6 +254,7 @@ |
255 | 255 | 'WikiMap' => 'includes/WikiMap.php', |
256 | 256 | 'WikiReference' => 'includes/WikiMap.php', |
257 | 257 | 'WikiXmlError' => 'includes/WikiError.php', |
| 258 | + 'WinCacheBagOStuff' => 'includes/BagOStuff.php', |
258 | 259 | 'XCacheBagOStuff' => 'includes/BagOStuff.php', |
259 | 260 | 'XmlDumpWriter' => 'includes/Export.php', |
260 | 261 | 'Xml' => 'includes/Xml.php', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -72,6 +72,7 @@ |
73 | 73 | is no title match in search and the user has no rights to create pages. |
74 | 74 | * (bug 23429) Added new hook WatchlistEditorBuildRemoveLine |
75 | 75 | * (bug 18488) Added maintenance script refreshCategoryCounts.php |
| 76 | +* (bug 22844) Added support for WinCache object caching |
76 | 77 | |
77 | 78 | === Bug fixes in 1.17 === |
78 | 79 | * (bug 17560) Half-broken deletion moved image files to deletion archive |