Bolt\Configuration\YamlUpdater::__construct PHP Method

__construct() public method

Creates an updater for the given file.
public __construct ( Silex\Application $app, string $filename = '' )
$app Silex\Application
$filename string The file to modify
    public function __construct(Silex\Application $app, $filename = '')
    {
        $this->file = $app['filesystem']->get('config://' . $filename, new File());
        $this->parser = new Parser();
        // Get the contents of the file
        $yaml = $this->file->read();
        // Check that the read-in YAML is valid
        $this->parsed = $this->parser->parse($yaml, true, true);
        // Create a searchable array
        $this->yaml = explode("\n", $yaml);
    }