Index: trunk/phase3/includes/ObjectCache.php |
— | — | @@ -32,7 +32,10 @@ |
33 | 33 | global $wgCaches; |
34 | 34 | $wgCaches = array(); |
35 | 35 | |
36 | | -/** @todo document */ |
| 36 | +/** |
| 37 | + * Get a cache object. |
| 38 | + * @param int $inputType cache type, one the the CACHE_* constants. |
| 39 | + */ |
37 | 40 | function &wfGetCache( $inputType ) { |
38 | 41 | global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent; |
39 | 42 | $cache = false; |
— | — | @@ -49,8 +52,7 @@ |
50 | 53 | |
51 | 54 | if ( $type == CACHE_MEMCACHED ) { |
52 | 55 | if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) { |
53 | | - require_once( 'memcached-client.php' ); |
54 | | - if ( !class_exists("MemcachedClientforWiki") ) { |
| 56 | + if ( !class_exists( 'MemcachedClientforWiki' ) ) { |
55 | 57 | class MemCachedClientforWiki extends memcached { |
56 | 58 | function _debugprint( $text ) { |
57 | 59 | wfDebug( "memcached: $text" ); |
— | — | @@ -104,18 +106,21 @@ |
105 | 107 | return $cache; |
106 | 108 | } |
107 | 109 | |
| 110 | +/** Get the main cache object */ |
108 | 111 | function &wfGetMainCache() { |
109 | 112 | global $wgMainCacheType; |
110 | 113 | $ret =& wfGetCache( $wgMainCacheType ); |
111 | 114 | return $ret; |
112 | 115 | } |
113 | 116 | |
| 117 | +/** Get the cache object used by the message cache */ |
114 | 118 | function &wfGetMessageCacheStorage() { |
115 | 119 | global $wgMessageCacheType; |
116 | 120 | $ret =& wfGetCache( $wgMessageCacheType ); |
117 | 121 | return $ret; |
118 | 122 | } |
119 | 123 | |
| 124 | +/** Get the cache object used by the parser cache */ |
120 | 125 | function &wfGetParserCacheStorage() { |
121 | 126 | global $wgParserCacheType; |
122 | 127 | $ret =& wfGetCache( $wgParserCacheType ); |