SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class RateLimit

Rate-limiting system, to prefent people form doing hacky stuff

Functions

NameVisibilityDescription
checkLimitIPpublic (static)Check that a given event has only been hit by the request ip address an allowable number of times
getHitCountpublic (static)Return the number of hits matching given conditions for a given time period
logHitprotected (static)Log a hit against the rate-limit system
logHitFailurepublic (static)Log a failure hit against the rate-limit system (e.g. password incorrect)
logHitSuccesspublic (static)Log a successful hit against the rate-limit system (e.g. user was logged in)

public checkLimitIP

bool RateLimit::checkLimitIP ( string $event , bool|null $success , int $limit , int $time );

Check that a given event has only been hit by the request ip address an allowable number of times

public getHitCount

int RateLimit::getHitCount ( array $conditions , int $time );

Return the number of hits matching given conditions for a given time period

protected logHit

void RateLimit::logHit ( string $event , bool $success , string $username );

Log a hit against the rate-limit system

public logHitFailure

void RateLimit::logHitFailure ( string $event [, string $username ] );

Log a failure hit against the rate-limit system (e.g. password incorrect)

public logHitSuccess

void RateLimit::logHitSuccess ( string $event [, string $username ] );

Log a successful hit against the rate-limit system (e.g. user was logged in)