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
Afficher le fichier Open project: bandwidth-throttle/token-bucket

Méthodes publiques

Méthode 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 méthode

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 méthode

public bootstrap ( $microtime )

getMicrotime() public méthode

public getMicrotime ( )

getMutex() public méthode

public getMutex ( )

isBootstrapped() public méthode

public isBootstrapped ( )

remove() public méthode

public remove ( )

setMicrotime() public méthode

public setMicrotime ( $microtime )