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)
array
append(string $key, mixed $value, string $delimiter)
If the property does not, it just adds it.
string
mixed
string
containsKey($key) : boolean
boolean
get(string $prop) : mixed
This function exists to provide a hashtable-like interface for properties.
see | \global\getProperty() |
---|
string
The property name (key).
mixed
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 | \global\get() |
---|
string
The property name (key).
mixed
isEmpty() : boolean
boolean
keys() : array
Use this for foreach() {} iterations, as this is faster than looping through property values.
array
load(\PhingFile $file) : void
propertyNames() : array
array
put(string $key, mixed $value)
This function exists to provide hashtable-lie interface for properties.
string
mixed
setProperty(string $key, mixed $value) : mixed
string
mixed
mixed
Old property value or NULL if none was set.store(\PhingFile $file, string $header) : void
string
Header text that will be placed (within comments) at the top of properties file.
\IOException |
- on error writing properties file. |
---|
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
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
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).$file : \PhingFile
$properties