protected function writeConfig($clear = true)
{
$output = $this->dumpConfig();
if ($output !== null && $output !== false) {
if ($this->doNotWriteConfigInTests) {
// simulate whether it would be successful
$success = is_writable($this->getLocalPath());
} else {
$success = @file_put_contents($this->getLocalPath(), $output);
}
if ($success === false) {
throw $this->getConfigNotWritableException();
}
}
if ($clear) {
$this->reload();
}
}