* It acts as a memcached server with no RAM, that is, all objects are
* cleared the moment they are set. All set operations succeed and all
* get operations return null.
* It acts as a memcached server with no RAM, that is, all objects are
* cleared the moment they are set. All set operations succeed and all
* get operations return null.
*/
class FakeMemCachedClient {
function add ($key, $val, $exp = 0) { return true; }
*/
class FakeMemCachedClient {
function add ($key, $val, $exp = 0) { return true; }
function &wfGetCache( $inputType ) {
global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent;
$cache = false;
function &wfGetCache( $inputType ) {
global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent;
$cache = false;
- if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
- require_once( 'memcached-client.php' );
-
- if (!class_exists("MemcachedClientforWiki")) {
+ if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) {
+ if ( !class_exists( 'MemcachedClientforWiki' ) ) {
- $cache =& $wgCaches[CACHE_DB];
- $cache->set_servers( $wgMemCachedServers );
- $cache->set_debug( $wgMemCachedDebug );
+ $wgCaches[CACHE_MEMCACHED]->set_servers( $wgMemCachedServers );
+ $wgCaches[CACHE_MEMCACHED]->set_debug( $wgMemCachedDebug );
} elseif ( $type == CACHE_ACCEL ) {
if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
if ( function_exists( 'eaccelerator_get' ) ) {
} elseif ( $type == CACHE_ACCEL ) {
if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
if ( function_exists( 'eaccelerator_get' ) ) {
if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) {
if ( !array_key_exists( CACHE_DB, $wgCaches ) ) {
$wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache');
if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) {
if ( !array_key_exists( CACHE_DB, $wgCaches ) ) {
$wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache');
function &wfGetMessageCacheStorage() {
global $wgMessageCacheType;
$ret =& wfGetCache( $wgMessageCacheType );
return $ret;
}
function &wfGetMessageCacheStorage() {
global $wgMessageCacheType;
$ret =& wfGetCache( $wgMessageCacheType );
return $ret;
}
function &wfGetParserCacheStorage() {
global $wgParserCacheType;
$ret =& wfGetCache( $wgParserCacheType );
return $ret;
}
function &wfGetParserCacheStorage() {
global $wgParserCacheType;
$ret =& wfGetCache( $wgParserCacheType );
return $ret;
}