- /**
- * Move a cache entry to the top (such as when accessed)
- */
- protected function pingCache( $key ) {
- if ( isset( $this->cache[$key] ) ) {
- $tmp = $this->cache[$key];
- unset( $this->cache[$key] );
- $this->cache[$key] = $tmp;
- }
- }
-
- /**
- * Limit cache memory
- */
- protected function trimCache() {
- while ( count( $this->cache ) >= self::MAX_CACHE_SIZE ) {
- reset( $this->cache );
- $key = key( $this->cache );
- wfDebug( __METHOD__ . ": evicting $key\n" );
- unset( $this->cache[$key] );
- }
- }
-