Class: Config_Lite
Source Location: /Config_Lite-0.2.4/Config/Lite.php
Config_Lite Class
Author(s):
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 885]
Config_Lite __construct(
[string
$filename = null], [int
$flags = null], [int
$mode = 0])
|
|
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 285]
string buildOutputString(
array
$sectionsarray)
|
|
Generated the output of the ini file, suitable for echo'ing or writing back to the ini file.
Parameters:
clear [line 608]
removes all sections and global options
count [line 846]
implemented for interface Countable
get [line 393]
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 442]
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 709]
returns the current filename
getIterator [line 835]
implemented for interface IteratorAggregate
getSection [line 504]
array getSection(
string
$sec, [array
$default = null])
|
|
returns an array of options of the given section
Parameters:
getString [line 352]
string getString(
string
$sec, string
$key, [mixed
$default = null])
|
|
returns a stripslashed string
Parameters:
has [line 545]
bool has(
string
$sec, [string
$key = null])
|
|
tests if a section or an option of a section exists
Parameters:
hasSection [line 529]
bool hasSection(
string
$sec)
|
|
returns true if the given section exists, otherwise false
Parameters:
isBool [line 183]
bool isBool(
string
$value)
|
|
detect Type "bool" by String Value to keep those "untouched"
Parameters:
normalizeValue [line 195]
string normalizeValue(
string
$value)
|
|
normalize a Value by determining the Type
Parameters:
offsetExists [line 798]
bool offsetExists(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
offsetGet [line 822]
mixed offsetGet(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
offsetSet [line 786]
void offsetSet(
string
$offset, mixed
$value)
|
|
implemented for interface ArrayAccess
Parameters:
offsetUnset [line 810]
void offsetUnset(
string
$offset)
|
|
implemented for interface ArrayAccess
Parameters:
read [line 116]
Config_Lite read(
[string
$filename = null], [int
$mode = INI_SCANNER_NORMAL])
|
|
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 565]
void remove(
string
$sec, [string
$key = null])
|
|
remove a section or an option of a section
Parameters:
removeSection [line 595]
void removeSection(
string
$sec)
|
|
remove section by name
Parameters:
save [line 146]
save the object to the filename (active record style)
serialize [line 857]
implemented for interface Serializable
set [line 648]
Config_Lite 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:
setDoubleTickDelimiter [line 225]
set string delimiter to double tick (")
setFilename [line 698]
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:
setFlags [line 239]
Set Flags ( FILE_USE_INCLUDE_PATH | FILE_APPEND | LOCK_EX ) for file-put-contents
Parameters:
setLinebreak [line 725]
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 742]
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 758]
Sets whether or not to doubleQuote If true, everything but bool and numeric values get doublequoted.
Parameters:
setSection [line 676]
set a given array with key/value pairs to a section, creates a new section if necessary.
Parameters:
setSingleTickDelimiter [line 214]
set string delimiter to single tick (')
setString [line 626]
Config_Lite 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 162]
sync the file to the object like `save', but after written the data, reads the data back into the object. This method is not for the average use-case, ie. for testing.
toBool [line 331]
string toBool(
string
$value)
|
|
converts string to a representable Config Bool Format
Parameters:
unserialize [line 869]
void unserialize(
string
$serializedData)
|
|
implemented for interface Serializable
Parameters:
write [line 264]
bool write(
string
$filename, array
$sectionsarray, [int
$flags = null])
|
|
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 773]
text presentation of the config object since a empty config is valid, it would return a empty string in that case.
Documentation generated on Mon, 11 Mar 2019 16:01:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|