public function decr( $key, $value = 1 ) {
return apc_dec( $key, $value );
}
-
- /**
- * @return Array
- */
- public function keys() {
- $info = apc_cache_info( 'user' );
- $list = $info['cache_list'];
- $keys = array();
-
- foreach ( $list as $entry ) {
- $keys[] = $entry['info'];
- }
-
- return $keys;
- }
}
* - server: A server info structure in the format required by each
* element in $wgDBServers.
*
- * - servers: An array of server info structures describing a set of
+ * - servers: An array of server info structures describing a set of
* database servers to distribute keys to. If this is
* specified, the "server" option will be ignored.
*
*
* - tableName: The table name to use, default is "objectcache".
*
- * - shards: The number of tables to use for data storage on each server.
+ * - shards: The number of tables to use for data storage on each server.
* If this is more than 1, table names will be formed in the style
* objectcacheNNN where NNN is the shard index, between 0 and
* shards-1. The number of digits will be the minimum number
}
# Don't keep timing out trying to connect for each call if the DB is down
- if ( isset( $this->connFailureErrors[$serverIndex] )
- && ( time() - $this->connFailureTimes[$serverIndex] ) < 60 )
+ if ( isset( $this->connFailureErrors[$serverIndex] )
+ && ( time() - $this->connFailureTimes[$serverIndex] ) < 60 )
{
throw $this->connFailureErrors[$serverIndex];
}
return $newValue;
}
- /**
- * @return Array
- */
- public function keys() {
- $result = array();
-
- for ( $serverIndex = 0; $serverIndex < $this->numServers; $serverIndex++ ) {
- try {
- $db = $this->getDB( $serverIndex );
- for ( $i = 0; $i < $this->shards; $i++ ) {
- $res = $db->select( $this->getTableNameByShard( $i ),
- array( 'keyname' ), false, __METHOD__ );
- foreach ( $res as $row ) {
- $result[] = $row->keyname;
- }
- }
- } catch ( DBError $e ) {
- $this->handleReadError( $e, $serverIndex );
- }
- }
- return $result;
- }
-
/**
* @param $exptime string
* @return bool