Sitellite Application Framework
Class Tree         Index         All Elements

Class: Ini

Source Location: Program_Root/Misc/Ini.php

Class Overview


Class for parsing, transforming, and writing files in the INI format, as defined by the PHP parse_ini_file() function.


Author(s)

Version

  • 1.2, 2003-09-29, $Id: Ini.php,v 1.2 2005/10/16 02:52:14 lux Exp $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 17]
Class for parsing, transforming, and writing files in the INI format, as defined by the PHP parse_ini_file() function.

New in 1.2:

  • Added ini_write() convenience function.
  • Added ability for filters to reverse themselves, which is used to properly write files that have been filtered on reading.




Tags:

version:  1.2, 2003-09-29, $Id: Ini.php,v 1.2 2005/10/16 02:52:14 lux Exp $


[ Top ]


Class Methods


constructor Ini [line 21]

Ini Ini( )

Constructor method.



[ Top ]

method addFilter [line 92]

void addFilter( string $func, [array $keys = array ()])

Adds a filter to the parse() process.



Parameters:

string   $func   function name of the filter
array   $keys   hash of keys to limit the filter to

[ Top ]

method clear [line 147]

void clear( )

Clears the list of registered filters, and adds one filter

back to the list, ini_filter_replace_backticks, which replaces backtick characters with double-quotes in values. This filter allows a second level of quotes to be used within a single INI value.




[ Top ]

method filter [line 106]

array filter( array $data, [boolean $sections = true], [boolean $reverse = false])

Filters the specified data through all registered filters.



Tags:

return:  hash of filtered INI data


Parameters:

array   $data   hash of parsed INI data
boolean   $sections  
boolean   $reverse  

[ Top ]

method fromXml [line 188]

array fromXml( string $data, [boolean $isFile = false])

Parses an XML document into an INI $struct, which can then be saved to a file or processed further.



Tags:

return:  hash


Parameters:

string   $data   XML data or file name
boolean   $isFile   is the $data a file

[ Top ]

method parse [line 34]

array parse( string $file, [boolean $sections = true])

Parses the specified file as an INI file. Please note that this method defaults to assuming INI files _do_ have $sections, whereas PHP's parse_ini_file() function assumes the opposite.



Tags:

return:  hash


Parameters:

string   $file  
boolean   $sections  

[ Top ]

method parseStr [line 49]

void parseStr( mixed $str, [mixed $sections = true])



[ Top ]

method toXml [line 160]

string toXml( array $struct)

Returns the specified INI structure as an XML document.

The root node is an <INI> tag, and subsequent tags all represent key names from the $struct.




Tags:

return:  XML data


Parameters:

array   $struct   hash

[ Top ]

method write [line 253]

string write( array $struct, [string $instructions = false])

Turns an INI structure into an INI formatted string, ready for writing to a file.



Parameters:

array   $struct   hash
string   $instructions   instructions to include as comments in the data

[ Top ]

method writeValue [line 226]

string writeValue( string $val)

Formats an individual value from an INI file, using quotes if any invalid characters are present.



Parameters:

string   $val  

[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:17:49 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2