PHP Class PrivateBin\Persistence\TrafficLimiter

Handles traffic limiting, so no user does more than one call per 10 seconds.
Inheritance: extends AbstractPersistence
Afficher le fichier Open project: privatebin/privatebin Class Usage Examples

Méthodes publiques

Méthode Description
canPass ( ) : boolean traffic limiter
getHash ( string $algo = 'sha512' ) : string get a HMAC of the current visitors IP address
setConfiguration ( Configuration $conf ) : void set configuration options of the traffic limiter
setLimit ( integer $limit ) : void set the time limit in seconds

Method Details

canPass() public static méthode

Make sure the IP address makes at most 1 request every 10 seconds.
public static canPass ( ) : boolean
Résultat boolean

getHash() public static méthode

get a HMAC of the current visitors IP address
public static getHash ( string $algo = 'sha512' ) : string
$algo string
Résultat string

setConfiguration() public static méthode

set configuration options of the traffic limiter
public static setConfiguration ( Configuration $conf ) : void
$conf PrivateBin\Configuration
Résultat void

setLimit() public static méthode

set the time limit in seconds
public static setLimit ( integer $limit ) : void
$limit integer
Résultat void