19 declare(strict_types=1);
38 $this->
namespace = $namespace;
73 $token = bin2hex(random_bytes(self::TOKEN_LENGTH / 2));
75 $token = md5(uniqid((
string) time(),
true));
76 $token = substr($token, 0, self::TOKEN_LENGTH);
88 foreach ($this->
namespace as $name) {
89 $namespace[] =
'"' . $name .
'"';
91 $output =
'new il.UI.core.URLBuilderToken([' . implode(
',', $namespace) .
'], "' . $this->name .
'", "' . $this->token .
'")';
getName()
Get the full name of the token including its namespace.
const SEPARATOR
Separator for parts of a parameter's namespace.
getToken()
Get the token hash value.
render()
Output the JS equivalent of the token as a string.
createToken()
Creates a randomized string of length URLBuilderToken::TOKEN_LENGTH generated by the random_bytes() f...
__construct(array $namespace, string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...