PHP Класс bandwidthThrottle\tokenBucket\storage\PDOStorage

This storage is in the global scope.
Автор: Markus Malkusch ([email protected])
Наследование: implements bandwidthThrottle\tokenBucket\storage\Storage, implements bandwidthThrottle\tokenBucket\storage\scope\GlobalScope
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $name, PDO $pdo ) Sets the PDO and the bucket's name for the shared storage.
bootstrap ( $microtime )
getMicrotime ( )
getMutex ( )
isBootstrapped ( )
remove ( )
setMicrotime ( $microtime )

Приватные методы

Метод Описание
forVendor ( array $map, string $default = "" ) : string Returns a vendor specific dialect value.
querySingleValue ( string $sql, array $parameters = [] ) : string Returns one value from a query.

Описание методов

__construct() публичный Метод

The name should be the same for all token buckets which share the same token storage. The transaction isolation level should avoid lost updates, i.e. it should be at least Repeatable Read.
public __construct ( string $name, PDO $pdo )
$name string The name of the token bucket.
$pdo PDO The PDO.

bootstrap() публичный Метод

public bootstrap ( $microtime )

getMicrotime() публичный Метод

public getMicrotime ( )

getMutex() публичный Метод

public getMutex ( )

isBootstrapped() публичный Метод

public isBootstrapped ( )

remove() публичный Метод

public remove ( )

setMicrotime() публичный Метод

public setMicrotime ( $microtime )