Overview

Namespaces

  • bandwidthThrottle
    • tokenBucket
      • storage
        • scope

Classes

  • FileStorage
  • IPCStorage
  • MemcachedStorage
  • MemcacheStorage
  • PDOStorage
  • PHPRedisStorage
  • PredisStorage
  • SessionStorage
  • SingleProcessStorage

Interfaces

  • Storage

Exceptions

  • StorageException
  • Overview
  • Namespace
  • Class

Class PDOStorage

PDO based storage which can be shared over a common DBS.

This storage is in the global scope.

bandwidthThrottle\tokenBucket\storage\PDOStorage implements bandwidthThrottle\tokenBucket\storage\Storage, bandwidthThrottle\tokenBucket\storage\scope\GlobalScope
Final
Namespace: bandwidthThrottle\tokenBucket\storage
License: WTFPL
Author: Markus Malkusch markus@malkusch.de
Link: Donations
Located at storage/PDOStorage.php
Methods summary
public
# __construct( string $name, PDO $pdo )

Sets the PDO and the bucket's name for the shared storage.

Sets the PDO and the bucket's name for the shared storage.

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.

Parameters

$name
The name of the token bucket.
$pdo
The PDO.

Throws

LengthException
The id should not be longer than 128 characters.
InvalidArgumentException
PDO must be configured to throw exceptions.
API documentation generated by ApiGen