53 $key = $table->
get(self::CONFIG_KEY);
71 public function get($raw =
false) {
81 if ($this->key[0] ===
'z') {
83 $base64 = strtr(
substr($this->key, 1),
'-_',
'+/');
84 $key = base64_decode($base64);
94 return hex2bin($this->key);
106 $secret = $this->
get();
107 if ($secret[0] !==
'z') {
108 $rand_max = getrandmax();
109 if ($rand_max < pow(2, 16)) {
113 if ($rand_max < pow(2, 32)) {
130 $key =
'z' . $this->crypto->getRandomString(31);
132 $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.
Thrown when there is a major problem with the installation.
__construct(Crypto $crypto, ConfigTable $table)
Constructor.
getStrength()
Get the strength of the site secret.
Manipulates values in the dbprefix_config table.