PHP Класс Spatie\UrlSigner\BaseUrlSigner

Наследование: implements Spatie\UrlSigner\UrlSigner
Показать файл Открыть проект

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

Свойство Тип Описание
$expiresParameter string The URL's query parameter name for the expiration.
$signatureKey string The key that is used to generate secure signatures.
$signatureParameter string The URL's query parameter name for the signature.

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

Метод Описание
__construct ( string $signatureKey, string $expiresParameter = 'expires', string $signatureParameter = 'signature' )
sign ( string $url, DateTime | integer $expiration ) : string Get a secure URL to a controller action.
validate ( string $url ) : boolean Validate a signed url.

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

Метод Описание
getExpirationTimestamp ( DateTime | integer $expiration ) : string Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days.
getIntendedUrl ( League\Url\UrlImmutable $url ) : League\Url\UrlImmutable Retrieve the intended URL by stripping off the UrlSigner specific parameters.
hasValidSignature ( League\Url\UrlImmutable $url ) : boolean Determine if the url has a forged signature.
isFuture ( integer $timestamp ) : boolean Check if an a timestamp is in the past.
isMissingAQueryParameter ( League\Url\Components\QueryInterface $query ) : boolean Check if a query is missing a necessary parameter.
signUrl ( League\Url\UrlImmutable $url, string $expiration, string $signature ) : League\Url\UrlImmutable Add expiration and signature query parameters to an url.

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

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

public __construct ( string $signatureKey, string $expiresParameter = 'expires', string $signatureParameter = 'signature' )
$signatureKey string
$expiresParameter string
$signatureParameter string

getExpirationTimestamp() защищенный Метод

Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days.
protected getExpirationTimestamp ( DateTime | integer $expiration ) : string
$expiration DateTime | integer The expiration date of this link. - DateTime: The value will be used as expiration date - int: The expiration time will be set to X days from now
Результат string

getIntendedUrl() защищенный Метод

Retrieve the intended URL by stripping off the UrlSigner specific parameters.
protected getIntendedUrl ( League\Url\UrlImmutable $url ) : League\Url\UrlImmutable
$url League\Url\UrlImmutable
Результат League\Url\UrlImmutable

hasValidSignature() защищенный Метод

Determine if the url has a forged signature.
protected hasValidSignature ( League\Url\UrlImmutable $url ) : boolean
$url League\Url\UrlImmutable
Результат boolean

isFuture() защищенный Метод

Check if an a timestamp is in the past.
protected isFuture ( integer $timestamp ) : boolean
$timestamp integer
Результат boolean

isMissingAQueryParameter() защищенный Метод

Check if a query is missing a necessary parameter.
protected isMissingAQueryParameter ( League\Url\Components\QueryInterface $query ) : boolean
$query League\Url\Components\QueryInterface
Результат boolean

sign() публичный Метод

Get a secure URL to a controller action.
public sign ( string $url, DateTime | integer $expiration ) : string
$url string
$expiration DateTime | integer
Результат string

signUrl() защищенный Метод

Add expiration and signature query parameters to an url.
protected signUrl ( League\Url\UrlImmutable $url, string $expiration, string $signature ) : League\Url\UrlImmutable
$url League\Url\UrlImmutable
$expiration string
$signature string
Результат League\Url\UrlImmutable

validate() публичный Метод

Validate a signed url.
public validate ( string $url ) : boolean
$url string
Результат boolean

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

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

The URL's query parameter name for the expiration.
protected string $expiresParameter
Результат string

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

The key that is used to generate secure signatures.
protected string $signatureKey
Результат string

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

The URL's query parameter name for the signature.
protected string $signatureParameter
Результат string