PHP Class bandwidthThrottle\tokenBucket\storage\MemcacheStorage

This storage is in the global scope.
Deprecation: 1.0.0 There's no support for the memcache extension under PHP-7. Consider using ext-mecached and {@link MemcachedStorage}. This storage will not be removed, however there's no guarantee that it will work. As soon as ext-memcache is available for PHP-7 the deprecation will be reverted.
Author: Markus Malkusch ([email protected])
Inheritance: implements bandwidthThrottle\tokenBucket\storage\Storage, implements bandwidthThrottle\tokenBucket\storage\scope\GlobalScope
Show file Open project: bandwidth-throttle/token-bucket

Public Methods

Method Description
__construct ( string $name, Memcache $memcache ) Sets the connected memcache API and the token bucket name.
bootstrap ( $microtime )
getMicrotime ( )
getMutex ( )
isBootstrapped ( )
remove ( )
setMicrotime ( $microtime )

Method Details

__construct() public method

The api needs to be connected already. I.e. Memcache::connect() was already called.
public __construct ( string $name, Memcache $memcache )
$name string The name of the shared token bucket.
$memcache Memcache The connected memcache API.

bootstrap() public method

public bootstrap ( $microtime )

getMicrotime() public method

public getMicrotime ( )

getMutex() public method

public getMutex ( )

isBootstrapped() public method

public isBootstrapped ( )

remove() public method

public remove ( )

setMicrotime() public method

public setMicrotime ( $microtime )