Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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. |
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 |
return | string |
protected getIntendedUrl ( League\Url\UrlImmutable $url ) : League\Url\UrlImmutable | ||
$url | League\Url\UrlImmutable | |
return | League\Url\UrlImmutable |
protected hasValidSignature ( League\Url\UrlImmutable $url ) : boolean | ||
$url | League\Url\UrlImmutable | |
return | boolean |
protected isMissingAQueryParameter ( League\Url\Components\QueryInterface $query ) : boolean | ||
$query | League\Url\Components\QueryInterface | |
return | boolean |
protected string $expiresParameter | ||
return | string |
protected string $signatureKey | ||
return | string |
protected string $signatureParameter | ||
return | string |