@@ -266,7 +266,7 @@ public static function setOption($optionName = "", $optionValue = "") {
266
266
}
267
267
268
268
$ arrayFinder = new ArrayFinder (self ::$ options );
269
- $ arrayFinder ->set ($ key , $ value );
269
+ $ arrayFinder ->set ($ optionName , $ optionValue );
270
270
self ::$ options = $ arrayFinder ->get ();
271
271
272
272
}
@@ -323,7 +323,8 @@ public static function updateConfigOption($optionName,$optionValue, $force = fal
323
323
} else if (self ::$ options ["overrideConfig " ] == "q " ) {
324
324
325
325
// standardize the values for comparison
326
- $ currentOptionValue = is_array (self ::$ options [$ optionName ]) ? implode (", " ,self ::$ options [$ optionName ]) : self ::$ options [$ optionName ];
326
+ $ currentOption = self ::getOption ($ optionName );
327
+ $ currentOptionValue = is_array ($ currentOption ) ? implode (", " ,$ currentOption ) : $ currentOption ;
327
328
$ newOptionValue = is_array ($ optionValue ) ? implode (", " ,$ optionValue ) : $ optionValue ;
328
329
329
330
if ($ currentOptionValue != $ newOptionValue ) {
@@ -373,18 +374,11 @@ protected static function writeUpdateConfigOption($optionName,$optionValue) {
373
374
Console::writeError ("Config parse error in <path> " .self ::$ userConfigPath ."</path>: " .$ e ->getMessage ());
374
375
}
375
376
376
- if (isset ($ options [$ optionName ]) && is_array ($ options [$ optionName ])) {
377
- $ optionValue = is_array ($ optionValue ) ? $ optionValue : array ($ optionValue );
378
- $ options [$ optionName ] = array_merge ($ options [$ optionName ], $ optionValue );
379
- } else {
380
- $ options [$ optionName ] = $ optionValue ;
381
- }
382
-
383
- // reload the options
384
- self ::$ options = $ options ;
377
+ print "foo " .$ optionName ." " .$ optionValue ;
378
+ self ::setOption ($ optionName , $ optionValue );
385
379
386
380
// dump the YAML
387
- $ configOutput = Yaml::dump ($ options , 3 );
381
+ $ configOutput = Yaml::dump (self :: $ options , 3 );
388
382
389
383
// write out the new config file
390
384
file_put_contents (self ::$ userConfigPath ,$ configOutput );
0 commit comments