Once i was looking for same thing and not found it =( at my current project i'm using extended Config class with 2 additional functions:
...
public function toString(){
$config = $this->toArray();
$string = '; config [2.0]'."\n";
foreach($config as $key => $option){
if(is_array($option)){
$string .= PHP_EOL.'['.$key.']'.PHP_EOL;
$stringify = http_build_query($option);
$stringify = str_replace(array('&', '%5B', '%5D', '=', '+'), array('"'.PHP_EOL, '.', '', ' = "', ' '), $stringify).'"';
$stringify = rawurldecode($stringify).PHP_EOL;
$string .= $stringify;
}
else{
$string .= $key.' = "'.$option.'"'.PHP_EOL;
}
}
return trim($string, PHP_EOL);
}
public function save($file){
$file = new IO\Adapter\File($file);
return $file->putContents($this->toString());
}
...
Not perfect, but i'm satisfied with it. Hope it can help you.