ZenMagick 0.9.8


org.zenmagick.core.ZMSettings
\core\ZMSettings.php at line 31

Class ZMSettings

ZMSettings

public class ZMSettings

Settings (ZenMagick's configuration).

Author:
DerManoMann
Version:
$Id: ZMSettings.php 2796 2009-12-29 22:08:18Z 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.

void

load(string yaml, boolean override)

Load mappings from a YAML style string.

static mixed

set(string name, mixed value)

Set configuration value.

static void

setAll(array settings)

Set a map of all settings.

Method Detail

\core\ZMSettings.php at line 88

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.

\core\ZMSettings.php at line 122

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.

\core\ZMSettings.php at line 110

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.

\core\ZMSettings.php at line 42

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.

\core\ZMSettings.php at line 69

getAll

public static array getAll()

Get a map of all settings.

Returns:
Map of all settings.

\core\ZMSettings.php at line 140

load

public void load(string yaml, boolean override)

Load mappings from a YAML style string.

Parameters:
yaml - The yaml style mappings.
override - Optional flag to control whether to override existing mappings or to merge; default is true to override.

\core\ZMSettings.php at line 57

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.

\core\ZMSettings.php at line 78

setAll

public static void setAll(array settings)

Set a map of all settings.

Parameters:
settings - Map of settings.

ZenMagick 0.9.8