Convenience class for reading and writing property files.
FIXME - Add support for arrays (separated by ',')
package |
phing.system.util |
---|---|
version |
$Id: 8f34abee863fbe1d54b43c38d69a87940c7d000f $ |
__construct(array $properties = NULL)
array
load(\PhingFile $file) : void
parse(string $filePath) : array
Saves a step since we don't have to parse and then check return value before throwing an error or setting class properties.
string
array
Properties loaded from file (no prop replacements done yet).
inVal(string $val) : mixed
does things like convert "true" => true
string
Trimmed value.
mixed
The new property value (may be boolean, etc.)
outVal(mixed $val) : string
does things like convert true => "true"
mixed
The property value (may be boolean, etc.)
string
toString() : string
Essentially this function creates a string representation of properties that is ready to write back out to a properties file. This is used by store() method.
string
store(\PhingFile $file = null, string $header = null) : void
throws |
|
---|
string
Header text that will be placed (within comments) at the top of properties file.
getProperties() : array
Mostly for performance reasons, property hashes are often preferable to passing around objects.
array
getProperty(string $prop) : mixed
This is the same as get() method.
see | \get() |
---|
string
The property name (key).
mixed
get(string $prop) : mixed
This function exists to provide a hashtable-like interface for properties.
see | \getProperty() |
---|
string
The property name (key).
mixed
setProperty(string $key, mixed $value) : mixed
string
mixed
mixed
Old property value or NULL if none was set.
put(string $key, mixed $value)
This function exists to provide hashtable-lie interface for properties.
string
mixed
append(string $key, mixed $value, string $delimiter = ',')
If the property does not, it just adds it.
string
mixed
string
propertyNames() : array
array
containsKey($key) : boolean
boolean
keys() : array
Use this for foreach() {} iterations, as this is faster than looping through property values.
array
isEmpty() : boolean
boolean
properties :