| Index: trunk/phase3/includes/objectcache/ObjectCache.php |
| — | — | @@ -58,10 +58,10 @@ |
| 59 | 59 | $candidates = array( $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType ); |
| 60 | 60 | foreach ( $candidates as $candidate ) { |
| 61 | 61 | if ( $candidate !== CACHE_NONE && $candidate !== CACHE_ANYTHING ) { |
| 62 | | - return self::newFromId( $candidate ); |
| | 62 | + return self::getInstance( $candidate ); |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | | - return self::newFromId( CACHE_DB ); |
| | 65 | + return self::getInstance( CACHE_DB ); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
| Index: trunk/phase3/includes/MemcachedSessions.php |
| — | — | @@ -92,4 +92,14 @@ |
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | 95 | |
| | 96 | +function memsess_write_close() { |
| | 97 | + session_write_close(); |
| | 98 | +} |
| | 99 | + |
| 96 | 100 | session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read', 'memsess_write', 'memsess_destroy', 'memsess_gc' ); |
| | 101 | + |
| | 102 | +// It's necessary to register a shutdown function to call session_write_close(), |
| | 103 | +// because by the time the request shutdown function for the session module is |
| | 104 | +// called, $wgMemc has already been destroyed. Shutdown functions registered |
| | 105 | +// this way are called before object destruction. |
| | 106 | +register_shutdown_function( 'memsess_write_close' ); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -1519,7 +1519,7 @@ |
| 1520 | 1520 | * The other parameters are dependent on the class used. |
| 1521 | 1521 | */ |
| 1522 | 1522 | $wgObjectCaches = array( |
| 1523 | | - CACHE_NONE => array( 'class' => 'FakeMemCachedClient' ), |
| | 1523 | + CACHE_NONE => array( 'class' => 'EmptyBagOStuff' ), |
| 1524 | 1524 | CACHE_DB => array( 'class' => 'SqlBagOStuff', 'table' => 'objectcache' ), |
| 1525 | 1525 | CACHE_DBA => array( 'class' => 'DBABagOStuff' ), |
| 1526 | 1526 | |