src/FS/File/Configuration/Converter.php
protected static function saveIni( $fileName, $data )
	{
		$creator	= new FS_File_INI_Creator( TRUE );
		foreach( $data as $sectionName => $sectionData )
		{
			$creator->addSection( $sectionName );
			foreach( $sectionData as $pair )
			{
				switch( $pair['type'] )
				{
					case 'string':
						$pair['value']	= '"'.addslashes( $pair['value'] ).'"';
						break;
					case 'bool':
					case 'boolean':
						$pair['value']	= $pair['value'] ? "yes" : "no";
						break;
				}
				$pair['comment']	= isset( $pair['comment'] ) ? $pair['type'].": ".$pair['comment'] : $pair['type'];
				$creator->addProperty( $pair['key'], $pair['value'], $pair['comment'] );
			}
		}
		return $creator->write( $fileName );
	}
protected static function saveIni( $fileName, $data )
	{
		$creator	= new FS_File_INI_Creator( TRUE );
		foreach( $data as $sectionName => $sectionData )
		{
			$creator->addSection( $sectionName );
			foreach( $sectionData as $pair )
			{
				switch( $pair['type'] )
				{
					case 'string':
						$pair['value']	= '"'.addslashes( $pair['value'] ).'"';
						break;
					case 'bool':
					case 'boolean':
						$pair['value']	= $pair['value'] ? "yes" : "no";
						break;
				}
				$pair['comment']	= isset( $pair['comment'] ) ? $pair['type'].": ".$pair['comment'] : $pair['type'];
				$creator->addProperty( $pair['key'], $pair['value'], $pair['comment'] );
			}
		}
		return $creator->write( $fileName );
	}
protected static function saveIni ( $ fileName , $ data ) { $ creator = new FS_File_INI_Creator ( TRUE ) ; foreach ( $ data as $ sectionName => $ sectionData ) { $ creator -> addSection ( $ sectionName ) ; foreach ( $ sectionData as $ pair ) { switch ( $ pair [ 'type' ] ) { case 'string' : $ pair [ 'value' ] = '"' . addslashes ( $ pair [ 'value' ] ) . '"' ; break ; case 'bool' : case 'boolean' : $ pair [ 'value' ] = $ pair [ 'value' ] ? "yes" : "no" ; break ; } $ pair [ 'comment' ] = isset ( $ pair [ 'comment' ] ) ? $ pair [ 'type' ] . ": " . $ pair [ 'comment' ] : $ pair [ 'type' ] ; $ creator -> addProperty ( $ pair [ 'key' ] , $ pair [ 'value' ] , $ pair [ 'comment' ] ) ; } } return $ creator -> write ( $ fileName ) ; }
Saves Configuration Data as INI File and returns Number of written Bytes.
@access		protected
@static
@param		string		$fileName		File Name of INI File
@param		array		$data			Configuration Data as Array
@return		int
Saves Configuration Data as INI File and returns Number of written Bytes .