|
MediaWiki
REL1_19
|
interface is intended to be more or less compatible with the PHP memcached client. More...

Public Member Functions | |
| add ($key, $value, $exptime=0) | |
| debug ($text) | |
| decr ($key, $value=1) | |
| delete ($key, $time=0) | |
| Delete an item. | |
| deleteObjectsExpiringBefore ($date, $progressCallback=false) | |
| Delete all objects expiring before a certain date. | |
| get ($key) | |
| Get an item with the given key. | |
| incr ($key, $value=1) | |
| keys () | |
| lock ($key, $timeout=0) | |
| replace ($key, $value, $exptime=0) | |
| set ($key, $value, $exptime=0) | |
| Set an item. | |
| setDebug ($bool) | |
| unlock ($key) | |
Protected Member Functions | |
| convertExpiry ($exptime) | |
| Convert an optionally relative time to an absolute time. | |
Private Attributes | |
| $debugMode = false | |
interface is intended to be more or less compatible with the PHP memcached client.
backends for local hash array and SQL table included: $bag = new HashBagOStuff(); $bag = new SqlBagOStuff(); # connect to db first
Definition at line 43 of file BagOStuff.php.
| BagOStuff::add | ( | $ | key, |
| $ | value, | ||
| $ | exptime = 0 |
||
| ) |
Reimplemented in DBABagOStuff, MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 110 of file BagOStuff.php.
| BagOStuff::convertExpiry | ( | $ | exptime | ) | [protected] |
Convert an optionally relative time to an absolute time.
Definition at line 159 of file BagOStuff.php.
Referenced by DBABagOStuff\encode(), HashBagOStuff\set(), and EhcacheBagOStuff\set().

| BagOStuff::debug | ( | $ | text | ) |
Definition at line 149 of file BagOStuff.php.
References wfDebug().
Referenced by SqlBagOStuff\get().


| BagOStuff::decr | ( | $ | key, |
| $ | value = 1 |
||
| ) |
Reimplemented in MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 145 of file BagOStuff.php.
References incr().

| BagOStuff::delete | ( | $ | key, |
| $ | time = 0 |
||
| ) | [abstract] |
Delete an item.
| $key | string |
| $time | int Amount of time to delay the operation (mostly memcached-specific) |
Reimplemented in SqlBagOStuff, DBABagOStuff, EhcacheBagOStuff, MemcachedPhpBagOStuff, WinCacheBagOStuff, MultiWriteBagOStuff, XCacheBagOStuff, HashBagOStuff, APCBagOStuff, and EmptyBagOStuff.
| BagOStuff::deleteObjectsExpiringBefore | ( | $ | date, |
| $ | progressCallback = false |
||
| ) |
Delete all objects expiring before a certain date.
| $date | The reference date in MW format |
| $progressCallback | Optional, a function which will be called regularly during long-running operations with the percentage progress as the first parameter. |
Reimplemented in SqlBagOStuff, and MultiWriteBagOStuff.
Definition at line 103 of file BagOStuff.php.
| BagOStuff::get | ( | $ | key | ) | [abstract] |
Get an item with the given key.
Returns false if it does not exist.
| $key | string |
Reimplemented in SqlBagOStuff, DBABagOStuff, MemcachedPhpBagOStuff, EhcacheBagOStuff, MultiWriteBagOStuff, HashBagOStuff, WinCacheBagOStuff, XCacheBagOStuff, APCBagOStuff, and EmptyBagOStuff.
| BagOStuff::incr | ( | $ | key, |
| $ | value = 1 |
||
| ) |
| $key | String: Key to increase |
| $value | Integer: Value to add to $key (Default 1) |
Reimplemented in SqlBagOStuff, MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 129 of file BagOStuff.php.
References $n, lock(), and unlock().
Referenced by decr().


| BagOStuff::keys | ( | ) |
Reimplemented in SqlBagOStuff, DBABagOStuff, WinCacheBagOStuff, HashBagOStuff, and APCBagOStuff.
Definition at line 89 of file BagOStuff.php.
| BagOStuff::lock | ( | $ | key, |
| $ | timeout = 0 |
||
| ) |
Reimplemented in MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 79 of file BagOStuff.php.
Referenced by incr().

| BagOStuff::replace | ( | $ | key, |
| $ | value, | ||
| $ | exptime = 0 |
||
| ) |
Reimplemented in MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 118 of file BagOStuff.php.
| BagOStuff::set | ( | $ | key, |
| $ | value, | ||
| $ | exptime = 0 |
||
| ) | [abstract] |
Set an item.
| $key | string |
| $value | mixed |
| $exptime | int Either an interval in seconds or a unix timestamp for expiry |
Reimplemented in SqlBagOStuff, DBABagOStuff, EhcacheBagOStuff, MemcachedPhpBagOStuff, MultiWriteBagOStuff, HashBagOStuff, WinCacheBagOStuff, XCacheBagOStuff, APCBagOStuff, and EmptyBagOStuff.
| BagOStuff::setDebug | ( | $ | bool | ) |
| $bool | bool |
Reimplemented in MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 49 of file BagOStuff.php.
| BagOStuff::unlock | ( | $ | key | ) |
Reimplemented in MemcachedPhpBagOStuff, and MultiWriteBagOStuff.
Definition at line 84 of file BagOStuff.php.
Referenced by incr().

BagOStuff::$debugMode = false [private] |
Definition at line 44 of file BagOStuff.php.