PHP Class bandwidthThrottle\tokenBucket\storage\FileStorage

This storage is in the global scope. However the scope is limited to the underlying filesystem. I.e. the scope is not shared between hosts.
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 Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $path ) Sets the file path and opens it.
__destruct ( ) Closes the file handle.
bootstrap ( $microtime )
getMicrotime ( )
getMutex ( )
isBootstrapped ( )
remove ( )
setMicrotime ( $microtime )

Private Methods

Méthode Description
open ( ) Opens the file and initializes the mutex.

Method Details

__construct() public méthode

If the file does not exist yet, it will be created. This is an atomic operation.
public __construct ( string $path )
$path string The file path.

__destruct() public méthode

Closes the file handle.
public __destruct ( )

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 )