1
0
Fork 0

Fix JsonConfigSource fallback on php5.3, refs #4972

pull/4977/head
Jordi Boggiano 2016-02-29 14:17:24 +00:00
parent f2e2dd8f86
commit 2ff19e4c62
1 changed files with 6 additions and 6 deletions

View File

@ -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]);