[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Object caching using a SQL database. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
File Size: | 787 lines (22 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
SqlBagOStuff:: (23 methods):
__construct()
getDB()
getTableByKey()
getTableNameByShard()
get()
getMulti()
setMulti()
set()
cas()
delete()
incr()
isExpired()
getMaxDateTime()
garbageCollect()
expireAll()
deleteObjectsExpiringBefore()
deleteAll()
serialize()
unserialize()
handleReadError()
handleWriteError()
markServerDown()
createTables()
MediaWikiBagOStuff:: (0 methods):
Class: SqlBagOStuff - X-Ref
Class to store objects in the database__construct( $params ) X-Ref |
Constructor. Parameters are: - 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 database servers to distribute keys to. If this is specified, the "server" option will be ignored. - purgePeriod: The average number of object cache requests in between garbage collection operations, where expired entries are removed from the database. Or in other words, the reciprocal of the probability of purging on any given request. If this is set to zero, purging will never be done. - tableName: The table name to use, default is "objectcache". - 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 required to hold the largest shard index. Data will be distributed across all tables by key hash. This is for MySQL bugs 61735 and 61736. param: array $params |
getDB( $serverIndex ) X-Ref |
Get a connection to the specified database param: int $serverIndex return: DatabaseBase |
getTableByKey( $key ) X-Ref |
Get the server index and table name for a given key param: string $key return: array Server index and table name |
getTableNameByShard( $index ) X-Ref |
Get the table name for a given shard index param: int $index return: string |
get( $key, &$casToken = null ) X-Ref |
param: string $key param: mixed $casToken [optional] return: mixed |
getMulti( array $keys ) X-Ref |
param: array $keys return: array |
setMulti( array $data, $expiry = 0 ) X-Ref |
param: array $data param: int $expiry return: bool |
set( $key, $value, $exptime = 0 ) X-Ref |
param: string $key param: mixed $value param: int $exptime return: bool |
cas( $casToken, $key, $value, $exptime = 0 ) X-Ref |
param: mixed $casToken param: string $key param: mixed $value param: int $exptime return: bool |
delete( $key, $time = 0 ) X-Ref |
param: string $key param: int $time return: bool |
incr( $key, $step = 1 ) X-Ref |
param: string $key param: int $step return: int|null |
isExpired( $db, $exptime ) X-Ref |
param: DatabaseBase $db param: string $exptime return: bool |
getMaxDateTime( $db ) X-Ref |
param: DatabaseBase $db return: string |
garbageCollect() X-Ref |
No description |
expireAll() X-Ref |
No description |
deleteObjectsExpiringBefore( $timestamp, $progressCallback = false ) X-Ref |
Delete objects from the database which expire before a certain date. param: string $timestamp param: bool|callable $progressCallback return: bool |
deleteAll() X-Ref |
No description |
serialize( &$data ) X-Ref |
Serialize an object and, if possible, compress the representation. On typical message and page data, this can provide a 3X decrease in storage requirements. param: mixed $data return: string |
unserialize( $serial ) X-Ref |
Unserialize and, if necessary, decompress an object. param: string $serial return: mixed |
handleReadError( DBError $exception, $serverIndex ) X-Ref |
Handle a DBError which occurred during a read operation. param: DBError $exception param: int $serverIndex |
handleWriteError( DBError $exception, $serverIndex ) X-Ref |
Handle a DBQueryError which occurred during a write operation. param: DBError $exception param: int $serverIndex |
markServerDown( $exception, $serverIndex ) X-Ref |
Mark a server down due to a DBConnectionError exception param: DBError $exception param: int $serverIndex |
createTables() X-Ref |
Create shard tables. For use from eval.php. |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |