r62301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62300‎ | r62301 | r62302 >
Date:12:33, 11 February 2010
Author:ialex
Status:ok
Tags:
Comment:
Implement keys() for APCBagOStuff
Modified paths:
  • /trunk/phase3/includes/BagOStuff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/BagOStuff.php
@@ -349,7 +349,7 @@
350350
351351 public function keys() {
352352 $db = $this->getDB();
353 - $res = $db->select( 'objectcache', array( 'keyname' ), false, __METHOD__ );
 353+ $res = $db->select( 'objectcache', array( 'keyname' ), false, __METHOD__ );
354354 $result = array();
355355 foreach ( $res as $row ) {
356356 $result[] = $row->keyname;
@@ -528,6 +528,16 @@
529529 apc_delete( $key );
530530 return true;
531531 }
 532+
 533+ public function keys() {
 534+ $info = apc_cache_info( 'user' );
 535+ $list = $info['cache_list'];
 536+ $keys = array();
 537+ foreach( $list as $entry ) {
 538+ $keys[] = $entry['info'];
 539+ }
 540+ return $keys;
 541+ }
532542 }
533543
534544

Status & tagging log