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
booleanget(string $prop) : mixed
This function exists to provide a hashtable-like interface for properties.
| see | \getProperty() |
|---|
stringThe property name (key).
mixedgetProperties() : array
Mostly for performance reasons, property hashes are often preferable to passing around objects.
arraygetProperty(string $prop) : mixed
This is the same as get() method.
| see | \get() |
|---|
stringThe property name (key).
mixedisEmpty() : boolean
booleankeys() : array
Use this for foreach() {} iterations, as this is faster than looping through property values.
arrayload(\PhingFile $file) : void
propertyNames() : array
arrayput(string $key, mixed $value)
This function exists to provide hashtable-lie interface for properties.
string
mixed
setProperty(string $key, mixed $value) : mixed
string
mixed
mixedOld property value or NULL if none was set.store(\PhingFile $file, string $header) : void
stringHeader 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.
stringinVal(string $val) : mixed
does things like convert "true" => true
stringTrimmed value.
mixedThe new property value (may be boolean, etc.)outVal(mixed $val) : string
does things like convert true => "true"
mixedThe property value (may be boolean, etc.)
stringparse(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
arrayProperties loaded from file (no prop replacements done yet).$file : \PhingFile
$properties