* In MemcachedSessions.php, register a shutdown function to shut down the session early, before $wgMemc is destroyed. I'm not sure why my recent changes caused this problem to show up now.
* Use EmptyBagOStuff instead of FakeMemCachedClient in DefaultSettings.php for CACHE_NONE.
* The other parameters are dependent on the class used.
*/
$wgObjectCaches = array(
- CACHE_NONE => array( 'class' => 'FakeMemCachedClient' ),
+ CACHE_NONE => array( 'class' => 'EmptyBagOStuff' ),
CACHE_DB => array( 'class' => 'SqlBagOStuff', 'table' => 'objectcache' ),
CACHE_DBA => array( 'class' => 'DBABagOStuff' ),
return true;
}
+function memsess_write_close() {
+ session_write_close();
+}
+
session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read', 'memsess_write', 'memsess_destroy', 'memsess_gc' );
+
+// It's necessary to register a shutdown function to call session_write_close(),
+// because by the time the request shutdown function for the session module is
+// called, $wgMemc has already been destroyed. Shutdown functions registered
+// this way are called before object destruction.
+register_shutdown_function( 'memsess_write_close' );
$candidates = array( $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType );
foreach ( $candidates as $candidate ) {
if ( $candidate !== CACHE_NONE && $candidate !== CACHE_ANYTHING ) {
- return self::newFromId( $candidate );
+ return self::getInstance( $candidate );
}
}
- return self::newFromId( CACHE_DB );
+ return self::getInstance( CACHE_DB );
}
/**