UriSigner

UriSigner

class UriSigner

Signs URIs.

Methods

__construct(string $secret, string $parameter = '_hash')

Constructor.

string sign(string $uri)

Signs a URI.

bool check(string $uri)

Checks that a URI contains the correct hash.

Details

__construct(string $secret, string $parameter = '_hash')

Constructor.

Parameters

string $secret A secret
string $parameter Query string parameter to use

string sign(string $uri)

Signs a URI.

The given URI is signed by adding the query string parameter which value depends on the URI and the secret.

Parameters

string $uri A URI to sign

Return Value

string The signed URI

bool check(string $uri)

Checks that a URI contains the correct hash.

The query string parameter must be the last one (as it is generated that way by the sign() method, it should never be a problem).

Parameters

string $uri A signed URI

Return Value

bool True if the URI is signed correctly, false otherwise

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/HttpKernel/UriSigner.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部