Config class: write yaml file
This commit is contained in:
parent
4e91eeb3ab
commit
d82f8e8011
1 changed files with 17 additions and 0 deletions
|
@ -54,4 +54,21 @@ class Config
|
|||
$yaml = new \Symfony\Component\Yaml\Parser();
|
||||
return $yaml->parse(file_get_contents($this->file));
|
||||
}
|
||||
|
||||
/*
|
||||
* Write array into confi*
|
||||
* Write array into config file
|
||||
*
|
||||
* @param array config new config
|
||||
*
|
||||
* @return FALSE if failed to write
|
||||
*/
|
||||
public function writeConfig($config)
|
||||
{
|
||||
$dumper = new \Symfony\Component\Yaml\Dumper();
|
||||
|
||||
$yaml = $dumper->dump($config, 2);
|
||||
|
||||
return file_put_contents($this->file, $yaml);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue