src/FS/File/Configuration/Converter.php
protected static function saveXml( $fileName, $data )
	{
		$root	= new XML_DOM_Node( "configuration" );
		foreach( $data as $sectionName => $sectionData )
		{
			$sectionNode	= new XML_DOM_Node( "section" );
			$sectionNode->setAttribute( 'name', $sectionName );			
			foreach( $sectionData as $pair )
			{
				$comment	= isset( $pair['comment'] ) ? $pair['comment'] : NULL;
				$valueNode	= new XML_DOM_Node( "value", $pair['value'] );
				$valueNode->setAttribute( 'type', $pair['type'] );
				$valueNode->setAttribute( 'name', $pair['key'] );
				if( isset( $pair['comment'] ) )
					$valueNode->setAttribute( 'comment', $comment );
				$sectionNode->addChild( $valueNode );
			}
			$root->addChild( $sectionNode );
		}
		return XML_DOM_FileWriter::save( $fileName, $root );
	}
protected static function saveXml( $fileName, $data )
	{
		$root	= new XML_DOM_Node( "configuration" );
		foreach( $data as $sectionName => $sectionData )
		{
			$sectionNode	= new XML_DOM_Node( "section" );
			$sectionNode->setAttribute( 'name', $sectionName );			
			foreach( $sectionData as $pair )
			{
				$comment	= isset( $pair['comment'] ) ? $pair['comment'] : NULL;
				$valueNode	= new XML_DOM_Node( "value", $pair['value'] );
				$valueNode->setAttribute( 'type', $pair['type'] );
				$valueNode->setAttribute( 'name', $pair['key'] );
				if( isset( $pair['comment'] ) )
					$valueNode->setAttribute( 'comment', $comment );
				$sectionNode->addChild( $valueNode );
			}
			$root->addChild( $sectionNode );
		}
		return XML_DOM_FileWriter::save( $fileName, $root );
	}
protected static function saveXml ( $ fileName , $ data ) { $ root = new XML_DOM_Node ( "configuration" ) ; foreach ( $ data as $ sectionName => $ sectionData ) { $ sectionNode = new XML_DOM_Node ( "section" ) ; $ sectionNode -> setAttribute ( 'name' , $ sectionName ) ; foreach ( $ sectionData as $ pair ) { $ comment = isset ( $ pair [ 'comment' ] ) ? $ pair [ 'comment' ] : NULL ; $ valueNode = new XML_DOM_Node ( "value" , $ pair [ 'value' ] ) ; $ valueNode -> setAttribute ( 'type' , $ pair [ 'type' ] ) ; $ valueNode -> setAttribute ( 'name' , $ pair [ 'key' ] ) ; if ( isset ( $ pair [ 'comment' ] ) ) $ valueNode -> setAttribute ( 'comment' , $ comment ) ; $ sectionNode -> addChild ( $ valueNode ) ; } $ root -> addChild ( $ sectionNode ) ; } return XML_DOM_FileWriter :: save ( $ fileName , $ root ) ; }
Saves Configuration Data as XML File and returns Number of written Bytes.
@access		protected
@static
@param		string		$fileName		File Name of XML File
@param		array		$data			Configuration Data as Array
@return		int
Saves Configuration Data as XML File and returns Number of written Bytes .