ZenMagick 0.9.6


org.zenmagick.ZMSettings

Class ZMSettings

ZMSettings

public class ZMSettings

Settings (ZenMagick's configuration).

Author:
DerManoMann
Version:
$Id: ZMSettings.php 1966 2009-02-14 10:52:50Z dermanomann $

Method Summary
static void

addAll(array settings, boolean replace)

Add a map of settings.

static mixed

append(string name, mixed value, string delim)

Append configuration value.

static boolean

exists(string name)

Check if a given setting exists.

static mixed

get(string name, mixed default)

Get the value for the given setting name.

static array

getAll()

Get a map of all settings.

static mixed

set(string name, mixed value)

Set configuration value.

static void

setAll(array settings)

Set a map of all settings.

Method Detail

addAll

public static void addAll(array settings, boolean replace)

Add a map of settings.

Parameters:
settings - Map of settings.
replace - If true existing settings will be replaced; default is true.

append

public static mixed append(string name, mixed value, string delim)

Append configuration value.

Parameters:
name - The setting to append to.
value - The value to append.
delim - Optional delimiter to be used if the value exists and is not empty; default is ''.
Returns:
The old setting value or null.

exists

public static boolean exists(string name)

Check if a given setting exists.

This is useful in cases where null is a valid setting value. In that case, the get method will be ambiguous and exists should be used.

.

Parameters:
name - The setting to check.
Returns:
true if a setting with the given name exists.

get

public static mixed get(string name, mixed default)

Get the value for the given setting name.

Parameters:
name - The setting to check.
default - Optional default value to be returned if setting not found; default is null.
Returns:
The setting value or null.

getAll

public static array getAll()

Get a map of all settings.

Returns:
Map of all settings.

set

public static mixed set(string name, mixed value)

Set configuration value.

Parameters:
name - The setting to check.
value - (New) value.
Returns:
The old setting value or null.

setAll

public static void setAll(array settings)

Set a map of all settings.

Parameters:
settings - Map of settings.

ZenMagick 0.9.6