protected function applyUserConfigOverrides()
{
// A whitelist of allowed overrides.
$overrideMap = ['api' => 'api', 'local.copy_on_windows' => 'local.copy_on_windows', 'local.drush_executable' => 'local.drush_executable', 'experimental' => 'experimental', 'updates' => 'updates'];
$userConfig = $this->getUserConfig();
if (!empty($userConfig)) {
foreach ($overrideMap as $userConfigKey => $configKey) {
$value = Util::getNestedArrayValue($userConfig, explode('.', $userConfigKey), $exists);
if ($exists) {
$configParents = explode('.', $configKey);
$default = Util::getNestedArrayValue(self::$config, $configParents, $defaultExists);
if ($defaultExists && is_array($default)) {
if (!is_array($value)) {
continue;
}
$value = array_replace_recursive($default, $value);
}
Util::setNestedArrayValue(self::$config, $configParents, $value, true);
}
}
}
}