37 $key = $table->
get(self::CONFIG_KEY);
55 public function get($raw =
false) {
65 if ($this->key[0] ===
'z') {
67 $base64 = strtr(
substr($this->key, 1),
'-_',
'+/');
68 $key = base64_decode($base64);
78 return hex2bin($this->key);
90 $secret = $this->
get();
91 if ($secret[0] !==
'z') {
92 $rand_max = getrandmax();
93 if ($rand_max < pow(2, 16)) {
97 if ($rand_max < pow(2, 32)) {
114 $key =
'z' . $this->crypto->getRandomString(31);
116 $this->table->set(self::CONFIG_KEY, $key);
Manages a site-specific secret key, encoded as a 32 byte string "secret".
regenerate()
Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL) and save to...
Exception thrown if an error which can only be found on runtime occurs.
get(string $name)
Gets a configuration value.
Updates the basic settings for the primary site object.
__construct(protected Crypto $crypto, protected ConfigTable $table)
Constructor.
Thrown when there is a major problem with the installation.
getStrength()
Get the strength of the site secret.
Manipulates values in the dbprefix_config table.