25 #require_once 'Zend/Config/Writer/FileAbstract.php'; 30 #require_once 'Zend/Config/Xml.php'; 49 $extends = $this->_config->getExtends();
50 $sectionName = $this->_config->getSectionName();
52 if (is_string($sectionName)) {
53 $child = $xml->addChild($sectionName);
55 $this->
_addBranch($this->_config, $child, $xml);
57 foreach ($this->_config as $sectionName =>
$data) {
59 $xml->addChild($sectionName, (
string)
$data);
61 $child = $xml->addChild($sectionName);
63 if (isset($extends[$sectionName])) {
72 $dom = dom_import_simplexml($xml)->ownerDocument;
73 $dom->formatOutput =
true;
75 $xmlString = $dom->saveXML();
93 if ($branchType ===
null) {
94 if (is_numeric($key)) {
95 $branchType =
'numeric';
96 $branchName = $xml->getName();
99 unset($parent->{$branchName});
101 $branchType =
'string';
103 }
else if ($branchType !== (is_numeric($key) ?
'numeric' :
'string')) {
104 #require_once 'Zend/Config/Exception.php'; 108 if ($branchType ===
'numeric') {
110 $child = $parent->addChild($branchName);
114 $parent->addChild($branchName, (
string)
$value);
118 $child = $xml->addChild($key);
122 $xml->addChild($key, (
string)
$value);
_addBranch(Zend_Config $config, SimpleXMLElement $xml, SimpleXMLElement $parent)