PHP Class ManaPHP\Security\RateLimiter

Inheritance: extends ManaPHP\Component, implements ManaPHP\Security\RateLimiterInterface
显示文件 Open project: manaphp/manaphp

Public Methods

Method Description
limit ( string | array $controllerAction, integer $duration, integer $ip_times, integer $user_times = null ) : void
limitAny ( string $resource, integer $duration, integer $ip_times, integer $user_times = null ) : void

Protected Methods

Method Description
_limit ( string $id, string $resource, integer $duration, integer $times ) : mixed

Method Details

_limit() abstract protected method

abstract protected _limit ( string $id, string $resource, integer $duration, integer $times ) : mixed
$id string
$resource string
$duration integer
$times integer
return mixed

limit() public method

public limit ( string | array $controllerAction, integer $duration, integer $ip_times, integer $user_times = null ) : void
$controllerAction string | array
$duration integer
$ip_times integer
$user_times integer
return void

limitAny() public method

public limitAny ( string $resource, integer $duration, integer $ip_times, integer $user_times = null ) : void
$resource string
$duration integer
$ip_times integer
$user_times integer
return void