PHP 인터페이스 yii\filters\RateLimitInterface

부터: 2.0
저자: Qiang Xue ([email protected])
파일 보기 프로젝트 열기: yiisoft/yii2 0 사용 예제들

공개 메소드들

메소드 설명
getRateLimit ( Request $request, Action $action ) : array Returns the maximum number of allowed requests and the window size.
loadAllowance ( Request $request, Action $action ) : array Loads the number of allowed requests and the corresponding timestamp from a persistent storage.
saveAllowance ( Request $request, Action $action, integer $allowance, integer $timestamp ) Saves the number of allowed requests and the corresponding timestamp to a persistent storage.

메소드 상세

getRateLimit() 공개 메소드

Returns the maximum number of allowed requests and the window size.
public getRateLimit ( Request $request, Action $action ) : array
$request yii\web\Request the current request
$action yii\base\Action the action to be executed
리턴 array an array of two elements. The first element is the maximum number of allowed requests, and the second element is the size of the window in seconds.

loadAllowance() 공개 메소드

Loads the number of allowed requests and the corresponding timestamp from a persistent storage.
public loadAllowance ( Request $request, Action $action ) : array
$request yii\web\Request the current request
$action yii\base\Action the action to be executed
리턴 array an array of two elements. The first element is the number of allowed requests, and the second element is the corresponding UNIX timestamp.

saveAllowance() 공개 메소드

Saves the number of allowed requests and the corresponding timestamp to a persistent storage.
public saveAllowance ( Request $request, Action $action, integer $allowance, integer $timestamp )
$request yii\web\Request the current request
$action yii\base\Action the action to be executed
$allowance integer the number of allowed requests remaining.
$timestamp integer the current timestamp.