GyroMemcache Class Reference
[Memcache]
Wrapper around memcache/memcached. More...
Static Public Member Functions |
|
static | add ($key, $value, $lifetime_in_seconds) |
Set data on server. |
|
static | add_server ($host= 'localhost', $port=11211) |
Add a server. |
|
static | decrement ($key, $by=1) |
Decrement a counter. |
|
static | delete ($key) |
Remove data. |
|
static | get ($key) |
Returns data from server. |
|
static | increment ($key, $by=1) |
Increment a counter. |
|
static | init () |
Init Memcache instance. |
|
static | set ($key, $value, $lifetime_in_seconds) |
Set data on server. |
Detailed Description
Wrapper around memcache/memcached.
Definition at line 8 of file memcache.cls.php.
Member Function Documentation
static GyroMemcache::add | ( | $ | key, | |
$ | value, | |||
$ | lifetime_in_seconds | |||
) | [static] |
Set data on server.
- Parameters:
-
string $key mixed $value int $lifetime_in_seconds
- Returns:
- bool TRUE on success, FALSE otherwise
Definition at line 69 of file memcache.cls.php.
static GyroMemcache::add_server | ( | $ | host =
'localhost' , |
|
$ | port = 11211 |
|||
) | [static] |
Add a server.
- Parameters:
-
string $host Server name or IP address int $port Port int $weight The weight of the server relative to the total weight of all the servers in the pool. This controls the probability of the server being selected for operations. This is used only with consistent distribution option and usually corresponds to the amount of memory available to memcache on that server.
Definition at line 42 of file memcache.cls.php.
static GyroMemcache::decrement | ( | $ | key, | |
$ | by = 1 |
|||
) | [static] |
Decrement a counter.
- Parameters:
-
string $key int $by
- Returns:
- int New Value or FALSE if $key does not exists
Definition at line 121 of file memcache.cls.php.
static GyroMemcache::delete | ( | $ | key | ) | [static] |
static GyroMemcache::get | ( | $ | key | ) | [static] |
Returns data from server.
- Parameters:
-
string $key
- Returns:
- mixed
Definition at line 57 of file memcache.cls.php.
static GyroMemcache::increment | ( | $ | key, | |
$ | by = 1 |
|||
) | [static] |
Increment a counter.
- Parameters:
-
string $key int $by
- Returns:
- int New Value or FALSE if $key does not exists
Definition at line 110 of file memcache.cls.php.
static GyroMemcache::init | ( | ) | [static] |
Init Memcache instance.
Definition at line 19 of file memcache.cls.php.
00019 { 00020 if (class_exists('Memcached')) { 00021 self::$delegate = new Memcached(Config::get_value(Config::TITLE)); 00022 } 00023 else if (class_exists('Memcache')) { 00024 self::$delegate = new Memcache(); 00025 } 00026 else { 00027 throw new Exception('GyroMemcache::init(): No memcache extension installed'); 00028 } 00029 }
static GyroMemcache::set | ( | $ | key, | |
$ | value, | |||
$ | lifetime_in_seconds | |||
) | [static] |
Set data on server.
- Parameters:
-
string $key mixed $value int $lifetime_in_seconds
Definition at line 85 of file memcache.cls.php.
The documentation for this class was generated from the following file:
- contributions/cache.memcache/lib/components/memcache.cls.php