Recommend this page to a friend! |
Download .zip |
Info | View files (4) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2002-10-09 (14 years ago) | Not enough user ratings | Total: 2,409 | All time: 1,555 This week: 946 |
Version | License | PHP version | Categories | |||
ini 1.0 | GNU General Publi... | 3 | Files and Folders, Parsers |
Description | Author | |||||||||||||
This class can read and parse INI files without using the parse_ini function. |
|
ini.class.php Version: 0.2 beta Author: Daniel Jaenecke <jaenecke@gmx.li> PHP-Version: 4.2.3 Beware: This class is still beta. It should work fine when used as described below, butt here is no real error-handling yet nor hast here been much testing. So just be aware... Purpose: Handle ini files :) You can simply use this class to read an ini-file and return as an array - just like parse_ini_file() does. But his class can do some more... Features: Handling default values You can load an additional defaults-file. Whenever you request an ini-value which is not set but available from the defaults it will be returned from there. Parsing of constants When using parse_ini_file() any value which represents a defined constants name is replaced by the according value - which can be quite useful, but is not always desired - and it cannot be turned off. the ini.class offers this as a feature. You can control the replacement by setting $parse_constants to TRUE/FALSE. Also, any value enclosed in single or double quotes will not be replaced by a constant's value, ignoring the setting of $parse_constants. Syntax of ini/default files Comments Comments start with # or //. Anything to the end of line is ignored. Empty lines are also ignored. Key-/Value pairs Assigning values to a key is done like key = value to prevent value from being replaced by the value of a constant with the same name you can enclose value in single or double quotes: key = "value" key = 'value' Since quotes are removed if they enclose a value you have to use them twice if they are desired, like key = ""value"" Sections Sections are enclosed into [ ]. Any section containing no key/value-pair is ignored. Anything else Any line not matching one of the patterns for section or key/value will be ignored. There is no error-handling yet! |
Files |
File | Role | Description |
---|---|---|
example | Doc. | small examples |
ini.class.php | Class | class definition |
properties.txt | Doc. | Methods and properties of ini.class.php |
README | Doc. | readme |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.