PHP 클래스 PrivateBin\Persistence\TrafficLimiter

Handles traffic limiting, so no user does more than one call per 10 seconds.
상속: extends AbstractPersistence
파일 보기 프로젝트 열기: privatebin/privatebin 1 사용 예제들

공개 메소드들

메소드 설명
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

메소드 상세

canPass() 공개 정적인 메소드

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

getHash() 공개 정적인 메소드

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

setConfiguration() 공개 정적인 메소드

set configuration options of the traffic limiter
public static setConfiguration ( Configuration $conf ) : void
$conf PrivateBin\Configuration
리턴 void

setLimit() 공개 정적인 메소드

set the time limit in seconds
public static setLimit ( integer $limit ) : void
$limit integer
리턴 void