class UriSigner

Signs URIs.

Methods

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

No description

string
sign(string $uri)

Signs a URI.

bool
check(string $uri)

Checks that a URI contains the correct hash.

Details

at line 28
__construct(string $secret, string $parameter = '_hash')

Parameters

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

at line 44
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

at line 66
bool check(string $uri)

Checks that a URI contains the correct hash.

Parameters

string $uri A signed URI

Return Value

bool True if the URI is signed correctly, false otherwise