ZenMagick 0.9.11


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

Class ZMSettings

ZMSettings

public class ZMSettings

Settings (ZenMagick's configuration).

Author:
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 void

load(string yaml, boolean override)

Load mappings from a YAML style string.

static mixed

set(string name, mixed value)

Set configuration value.

Method Detail

core\ZMSettings.php at line 86

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 120

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 108

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 41

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 76

getAll

public static array getAll()

Get a map of all settings.

Returns:
Map of all settings.

core\ZMSettings.php at line 138

load

public static 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 58

set

public static mixed set(string name, mixed value)

Set configuration value.

A value of null will remove the setting.

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

ZenMagick 0.9.11