r43506 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43505‎ | r43506 | r43507 >
Date:22:45, 14 November 2008
Author:ialex
Status:ok
Tags:
Comment:
* Removed the inclusion of memcached-client.php since this file is autoloaded
* Document a bit
Modified paths:
  • /trunk/phase3/includes/ObjectCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ObjectCache.php
@@ -32,7 +32,10 @@
3333 global $wgCaches;
3434 $wgCaches = array();
3535
36 -/** @todo document */
 36+/**
 37+ * Get a cache object.
 38+ * @param int $inputType cache type, one the the CACHE_* constants.
 39+ */
3740 function &wfGetCache( $inputType ) {
3841 global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent;
3942 $cache = false;
@@ -49,8 +52,7 @@
5053
5154 if ( $type == CACHE_MEMCACHED ) {
5255 if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) {
53 - require_once( 'memcached-client.php' );
54 - if ( !class_exists("MemcachedClientforWiki") ) {
 56+ if ( !class_exists( 'MemcachedClientforWiki' ) ) {
5557 class MemCachedClientforWiki extends memcached {
5658 function _debugprint( $text ) {
5759 wfDebug( "memcached: $text" );
@@ -104,18 +106,21 @@
105107 return $cache;
106108 }
107109
 110+/** Get the main cache object */
108111 function &wfGetMainCache() {
109112 global $wgMainCacheType;
110113 $ret =& wfGetCache( $wgMainCacheType );
111114 return $ret;
112115 }
113116
 117+/** Get the cache object used by the message cache */
114118 function &wfGetMessageCacheStorage() {
115119 global $wgMessageCacheType;
116120 $ret =& wfGetCache( $wgMessageCacheType );
117121 return $ret;
118122 }
119123
 124+/** Get the cache object used by the parser cache */
120125 function &wfGetParserCacheStorage() {
121126 global $wgParserCacheType;
122127 $ret =& wfGetCache( $wgParserCacheType );

Status & tagging log