Piwik\Config::writeConfig PHP Method

writeConfig() protected method

Write user configuration file
protected writeConfig ( boolean $clear = true )
$clear boolean
    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();
        }
    }