PHP Класс Cartalyst\Sentinel\Throttling\IlluminateThrottleRepository

Наследование: implements Cartalyst\Sentinel\Throttling\ThrottleRepositoryInterface, use trait Cartalyst\Support\Traits\RepositoryTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$globalInterval integer The interval which failed logins are checked, to prevent brute force.
$globalThresholds integer | array If an array is set, the key is the number of failed login attempts and the value is the delay in seconds before another login can occur. If an integer is set, it represents the number of attempts before throttling locks out in the current interval.
$globalThrottles Illuminate\Database\Eloquent\Collection Cached global throttles collection within the interval.
$ipInterval integer The interval at which point one IP address' failed logins are checked.
$ipThresholds integer | array Works identical to global thresholds, except specific to an IP address.
$ipThrottles array The cached IP address throttle collections within the interval.
$userInterval integer The interval at which point failed logins for one user are checked.
$userThresholds integer | array Works identical to global and IP address thresholds, regarding a user.
$userThrottles Illuminate\Database\Eloquent\Collection The cached user throttle collections within the interval.

Открытые методы

Метод Описание
__construct ( string $model = 'Cartalyst\Sentinel\Throttling\EloquentThrottle', integer $globalInterval = null, integer | array $globalThresholds = null, integer $ipInterval = null, integer | array $ipThresholds = null, integer $userInterval = null, integer | array $userThresholds = null ) : void Create a new Illuminate throttle repository.
getGlobalInterval ( ) : integer Returns the global interval.
getGlobalThresholds ( ) : integer | array Returns the global thresholds.
getIpInterval ( ) : integer Returns the IP address interval.
getIpThresholds ( ) : integer | array Returns the IP address thresholds.
getUserInterval ( ) : integer Returns the user interval.
getUserThresholds ( ) : integer | array Returns the user thresholds.
globalDelay ( ) {@inheritDoc}
ipDelay ( $ipAddress ) {@inheritDoc}
log ( $ipAddress = null, Cartalyst\Sentinel\Users\UserInterface $user = null ) {@inheritDoc}
setGlobalInterval ( integer $globalInterval ) : void Sets the global interval.
setGlobalThresholds ( integer | array $globalThresholds ) : void Sets the global thresholds.
setIpInterval ( integer $ipInterval ) : void Sets the IP address interval.
setIpThresholds ( integer | array $ipThresholds ) : void Sets the IP address thresholds.
setUserInterval ( integer $userInterval ) : void Sets the user interval.
setUserThresholds ( integer | array $userThresholds ) : void Sets the user thresholds.
userDelay ( Cartalyst\Sentinel\Users\UserInterface $user ) {@inheritDoc}

Защищенные методы

Метод Описание
delay ( string $type, mixed $argument = null ) : integer Returns a delay for the given type.
getGlobalThrottles ( ) : Illuminate\Database\Eloquent\Collection Returns the global throttles collection.
getIpThrottles ( string $ipAddress ) : Illuminate\Database\Eloquent\Collection Returns the IP address throttles collection.
getUserThrottles ( Cartalyst\Sentinel\Users\UserInterface $user ) : Illuminate\Database\Eloquent\Collection Returns the user throttles collection.
loadGlobalThrottles ( ) : Illuminate\Database\Eloquent\Collection Loads and returns the global throttles collection.
loadIpThrottles ( string $ipAddress ) : Illuminate\Database\Eloquent\Collection Loads and returns the IP address throttles collection.
loadUserThrottles ( Cartalyst\Sentinel\Users\UserInterface $user ) : Illuminate\Database\Eloquent\Collection Loads and returns the user throttles collection.
secondsToFree ( EloquentThrottle $throttle, integer $interval ) : integer Returns the seconds to free based on the given throttle and the presented delay in seconds, by comparing it to now.

Описание методов

__construct() публичный метод

Create a new Illuminate throttle repository.
public __construct ( string $model = 'Cartalyst\Sentinel\Throttling\EloquentThrottle', integer $globalInterval = null, integer | array $globalThresholds = null, integer $ipInterval = null, integer | array $ipThresholds = null, integer $userInterval = null, integer | array $userThresholds = null ) : void
$model string
$globalInterval integer
$globalThresholds integer | array
$ipInterval integer
$ipThresholds integer | array
$userInterval integer
$userThresholds integer | array
Результат void

delay() защищенный метод

Returns a delay for the given type.
protected delay ( string $type, mixed $argument = null ) : integer
$type string
$argument mixed
Результат integer

getGlobalInterval() публичный метод

Returns the global interval.
public getGlobalInterval ( ) : integer
Результат integer

getGlobalThresholds() публичный метод

Returns the global thresholds.
public getGlobalThresholds ( ) : integer | array
Результат integer | array

getGlobalThrottles() защищенный метод

Returns the global throttles collection.
protected getGlobalThrottles ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

getIpInterval() публичный метод

Returns the IP address interval.
public getIpInterval ( ) : integer
Результат integer

getIpThresholds() публичный метод

Returns the IP address thresholds.
public getIpThresholds ( ) : integer | array
Результат integer | array

getIpThrottles() защищенный метод

Returns the IP address throttles collection.
protected getIpThrottles ( string $ipAddress ) : Illuminate\Database\Eloquent\Collection
$ipAddress string
Результат Illuminate\Database\Eloquent\Collection

getUserInterval() публичный метод

Returns the user interval.
public getUserInterval ( ) : integer
Результат integer

getUserThresholds() публичный метод

Returns the user thresholds.
public getUserThresholds ( ) : integer | array
Результат integer | array

getUserThrottles() защищенный метод

Returns the user throttles collection.
protected getUserThrottles ( Cartalyst\Sentinel\Users\UserInterface $user ) : Illuminate\Database\Eloquent\Collection
$user Cartalyst\Sentinel\Users\UserInterface
Результат Illuminate\Database\Eloquent\Collection

globalDelay() публичный метод

{@inheritDoc}
public globalDelay ( )

ipDelay() публичный метод

{@inheritDoc}
public ipDelay ( $ipAddress )

loadGlobalThrottles() защищенный метод

Loads and returns the global throttles collection.
protected loadGlobalThrottles ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

loadIpThrottles() защищенный метод

Loads and returns the IP address throttles collection.
protected loadIpThrottles ( string $ipAddress ) : Illuminate\Database\Eloquent\Collection
$ipAddress string
Результат Illuminate\Database\Eloquent\Collection

loadUserThrottles() защищенный метод

Loads and returns the user throttles collection.
protected loadUserThrottles ( Cartalyst\Sentinel\Users\UserInterface $user ) : Illuminate\Database\Eloquent\Collection
$user Cartalyst\Sentinel\Users\UserInterface
Результат Illuminate\Database\Eloquent\Collection

log() публичный метод

{@inheritDoc}
public log ( $ipAddress = null, Cartalyst\Sentinel\Users\UserInterface $user = null )
$user Cartalyst\Sentinel\Users\UserInterface

secondsToFree() защищенный метод

Returns the seconds to free based on the given throttle and the presented delay in seconds, by comparing it to now.
protected secondsToFree ( EloquentThrottle $throttle, integer $interval ) : integer
$throttle EloquentThrottle
$interval integer
Результат integer

setGlobalInterval() публичный метод

Sets the global interval.
public setGlobalInterval ( integer $globalInterval ) : void
$globalInterval integer
Результат void

setGlobalThresholds() публичный метод

Sets the global thresholds.
public setGlobalThresholds ( integer | array $globalThresholds ) : void
$globalThresholds integer | array
Результат void

setIpInterval() публичный метод

Sets the IP address interval.
public setIpInterval ( integer $ipInterval ) : void
$ipInterval integer
Результат void

setIpThresholds() публичный метод

Sets the IP address thresholds.
public setIpThresholds ( integer | array $ipThresholds ) : void
$ipThresholds integer | array
Результат void

setUserInterval() публичный метод

Sets the user interval.
public setUserInterval ( integer $userInterval ) : void
$userInterval integer
Результат void

setUserThresholds() публичный метод

Sets the user thresholds.
public setUserThresholds ( integer | array $userThresholds ) : void
$userThresholds integer | array
Результат void

userDelay() публичный метод

{@inheritDoc}
public userDelay ( Cartalyst\Sentinel\Users\UserInterface $user )
$user Cartalyst\Sentinel\Users\UserInterface

Описание свойств

$globalInterval защищенное свойство

The interval which failed logins are checked, to prevent brute force.
protected int $globalInterval
Результат integer

$globalThresholds защищенное свойство

If an array is set, the key is the number of failed login attempts and the value is the delay in seconds before another login can occur. If an integer is set, it represents the number of attempts before throttling locks out in the current interval.
protected int|array $globalThresholds
Результат integer | array

$globalThrottles защищенное свойство

Cached global throttles collection within the interval.
protected Collection,Illuminate\Database\Eloquent $globalThrottles
Результат Illuminate\Database\Eloquent\Collection

$ipInterval защищенное свойство

The interval at which point one IP address' failed logins are checked.
protected int $ipInterval
Результат integer

$ipThresholds защищенное свойство

Works identical to global thresholds, except specific to an IP address.
protected int|array $ipThresholds
Результат integer | array

$ipThrottles защищенное свойство

The cached IP address throttle collections within the interval.
protected array $ipThrottles
Результат array

$userInterval защищенное свойство

The interval at which point failed logins for one user are checked.
protected int $userInterval
Результат integer

$userThresholds защищенное свойство

Works identical to global and IP address thresholds, regarding a user.
protected int|array $userThresholds
Результат integer | array

$userThrottles защищенное свойство

The cached user throttle collections within the interval.
protected Collection,Illuminate\Database\Eloquent $userThrottles
Результат Illuminate\Database\Eloquent\Collection