Class: Config_Lite
Source Location: /Config_Lite-0.1.5/Config/Lite.php
Config_Lite Class
Author(s):
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 828]
Config_Lite __construct(
[string
$filename = null])
|
|
takes an optional filename, if the file exists, also reads it. the `save' and `read' methods relies on a setted filename, but you can also use `setFilename' to set the filename.
Parameters:
buildOutputString [line 230]
string buildOutputString(
string
$sectionsarray)
|
|
Generated the output of the ini file, suitable for echo'ing or writing back to the ini file.
Parameters:
clear [line 554]
removes all sections and global options
count [line 791]
implemented for interface Countable
get [line 338]
mixed get(
[string
$sec = null], [string
$key = null], [mixed
$default = null])
|
|
get an option by section, a global option or all sections and options to get an option by section, call get with a section and the option. To get a global option call `get' with null as section. Just call `get' without any parameters to get all sections and options. The third parameter is an optional default value to return, if the option is not set, this is practical when dealing with editable files, to keep an application stable with default settings.
Parameters:
getBool [line 387]
bool getBool(
string
$sec, string
$key, [bool
$default = null])
|
|
returns a boolean for strict equality comparison returns "on", "yes", 1, "true" as TRUE and no given value or "off", "no", 0, "false" as FALSE
Parameters:
getFilename [line 654]
returns the current filename
getIterator [line 780]
implemented for interface IteratorAggregate
getSection [line 449]
array getSection(
string
$sec, [array
$default = null])
|
|
returns an array of options of the given section
Parameters:
getString [line 297]
string getString(
string
$sec, string
$key, [mixed
$default = null])
|
|
returns a stripslashed string
Parameters:
has [line 490]
bool has(
string
$sec, [string
$key = null])
|
|
tests if a section or an option of a section exists
Parameters:
hasSection [line 474]
bool hasSection(
string
$sec)
|
|
returns true if the given section exists, otherwise false
Parameters:
isBool [line 165]
bool isBool(
string
$value)
|
|
detect Type "bool" by String Value to keep those "untouched"
Parameters:
normalizeValue [line 177]
string normalizeValue(
string
$value)
|
|
normalize a Value by determining the Type
Parameters:
offsetExists [line 743]
bool offsetExists(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
offsetGet [line 767]
mixed offsetGet(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
offsetSet [line 731]
void offsetSet(
string
$offset, mixed
$value)
|
|
implemented for interface ArrayAccess
Parameters:
offsetUnset [line 755]
void offsetUnset(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
read [line 101]
void read(
[string
$filename = null])
|
|
the read method parses the optional given filename or already setted filename. this method uses the native PHP function parse_ini_file behind the scenes.
Parameters:
remove [line 510]
void remove(
string
$sec, [string
$key = null])
|
|
remove a section or an option of a section
Parameters:
removeSection [line 541]
void removeSection(
string
$sec)
|
|
remove section by name
Parameters:
save [line 129]
save the object to the already setted filename (active record style)
serialize [line 802]
implemented for interface Serializable
set [line 593]
$this set(
string
$sec, string
$key, [mixed
$value = null])
|
|
to add key/value pairs creates new section if necessary and overrides existing keys. To set a global, "sectionless" value, call set with null as section.
Parameters:
setFilename [line 643]
$this setFilename(
string
$filename)
|
|
filename to read or save the full filename with suffix, ie. `[PATH/]<ApplicationName>.ini'. you can also set the filename as parameter to the constructor.
Parameters:
setLinebreak [line 670]
$this setLinebreak(
string
$linebreakchars)
|
|
set the line break (newline) chars line-break defaults to Unix Newline "\n", set to support other linebreaks, eg. windows user textfiles "\r\n"
Parameters:
setProcessSections [line 687]
$this setProcessSections(
bool
$processSections)
|
|
Sets whether or not sections should be processed If true, values for each section will be placed into a sub-array for the section. If false, all values will be placed in the global scope.
Parameters:
setQuoteStrings [line 703]
$this setQuoteStrings(
bool
$quoteStrings)
|
|
Sets whether or not to doubleQuote If true, everything but bool and numeric values get doublequoted.
Parameters:
setSection [line 621]
$this setSection(
string
$sec, array
$pairs)
|
|
set a given array with key/value pairs to a section, creates a new section if necessary.
Parameters:
setString [line 571]
$this setString(
string
$sec, string
$key, [mixed
$value = null])
|
|
like set, but adds slashes to the value creates new section if necessary and overrides existing keys.
Parameters:
sync [line 145]
sync the file to the object like `save', but after written the data, reads the data back into the object. The method is inspired by QTSettings. Ideal for testing.
toBool [line 276]
string toBool(
string
$value)
|
|
converts string to a representable Config Bool Format
Parameters:
unserialize [line 814]
void unserialize(
string
$serializedData)
|
|
implemented for interface Serializable
Parameters:
write [line 209]
bool write(
string
$filename, array
$sectionsarray)
|
|
generic write ini config file, to save use `save'. writes the global options and sections with normalized Values, that means "bool" values to human readable representation, doublequotes strings and numeric values without any quotes. prepends a php exit if suffix is php, it is valid to write an empty Config file, this method is used by save and is public for explicit usage, eg. if you do not want to hold the whole configuration in the object.
Parameters:
__toString [line 718]
text presentation of the config object since a empty config is valid, it would return a empty string in that case.
Documentation generated on Tue, 16 Apr 2013 17:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|
|