Fix JsonConfigSource fallback on php5.3, refs #4972
parent
f2e2dd8f86
commit
2ff19e4c62
|
@ -79,11 +79,11 @@ class JsonConfigSource implements ConfigSourceInterface
|
|||
*/
|
||||
public function addConfigSetting($name, $value)
|
||||
{
|
||||
$that = $this;
|
||||
$this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($that) {
|
||||
$authConfig = $this->authConfig;
|
||||
$this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($authConfig) {
|
||||
if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
|
||||
list($key, $host) = explode('.', $key, 2);
|
||||
if ($that->authConfig) {
|
||||
if ($authConfig) {
|
||||
$config[$key][$host] = $val;
|
||||
} else {
|
||||
$config['config'][$key][$host] = $val;
|
||||
|
@ -99,11 +99,11 @@ class JsonConfigSource implements ConfigSourceInterface
|
|||
*/
|
||||
public function removeConfigSetting($name)
|
||||
{
|
||||
$that = $this;
|
||||
$this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($that) {
|
||||
$authConfig = $this->authConfig;
|
||||
$this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($authConfig) {
|
||||
if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
|
||||
list($key, $host) = explode('.', $key, 2);
|
||||
if ($that->authConfig) {
|
||||
if ($authConfig) {
|
||||
unset($config[$key][$host]);
|
||||
} else {
|
||||
unset($config['config'][$key][$host]);
|
||||
|
|
Loading…
Reference in New Issue