LazyRecord\ConfigLoader::writeToSymbol PHP Method

writeToSymbol() public method

public writeToSymbol ( )
    public function writeToSymbol()
    {
        if (!file_exists($this->symbolFilename)) {
            throw new Exception('symbol link ' . $this->symbolFilename . ' does not exist.');
        }
        $targetFile = readlink($this->symbolFilename);
        if ($targetFile === false || !file_exists($targetFile)) {
            throw new Exception('Missing target config file. incorrect symbol link.');
        }
        $yaml = Yaml::dump($this->config, $inlineLevel = 4, $indentSpaces = 2, $exceptionOnInvalidType = true);
        if (false === file_put_contents($targetFile, "---\n" . $yaml)) {
            throw new Exception("YAML config update failed: {$targetFile}");
        }
        return true;
    }