Tentative de régler le bordel

This commit is contained in:
Gauvain Boiché
2020-03-31 15:58:31 +02:00
parent a1864c0414
commit 459b46df7b
345 changed files with 10758 additions and 4066 deletions

View File

@@ -147,6 +147,25 @@ class config implements \ArrayAccess, \IteratorAggregate, \Countable
return false;
}
/**
* Checks configuration option's value only if the new_value matches the
* current configuration value and the configuration value does exist.Called
* only after set_atomic has been called.
*
* @param string $key The configuration option's name
* @param string $new_value New configuration value
* @throws \phpbb\exception\http_exception when config value is set and not equal to new_value.
* @return bool True if the value was changed, false otherwise.
*/
public function ensure_lock($key, $new_value)
{
if (isset($this->config[$key]) && $this->config[$key] == $new_value)
{
return true;
}
throw new \phpbb\exception\http_exception(500, 'Failure while aqcuiring locks.');
}
/**
* Increments an integer configuration value.
*