class config implements tool_interface

Migration config tool

Properties

protected config $config

Methods

__construct(config $config)

Constructor

string
get_name()

Retrieve a short name used for commands in migrations.

null
add(string $config_name, mixed $config_value, bool $is_dynamic = false)

Add a config setting.

null
update(string $config_name, mixed $config_value)

Update an existing config setting.

null
update_if_equals(string $compare, string $config_name, mixed $config_value)

Update a config setting if the first argument equal to the current config value

null
remove(string $config_name)

Remove an existing config setting.

null
reverse()

Reverse an original install action

Details

at line 29
__construct(config $config)

Constructor

Parameters

config $config

at line 37
string get_name()

Retrieve a short name used for commands in migrations.

Return Value

string

short name

at line 52
null add(string $config_name, mixed $config_value, bool $is_dynamic = false)

Add a config setting.

Parameters

string $config_name

The name of the config setting you would like to add

mixed $config_value

The value of the config setting

bool $is_dynamic

True if it is dynamic (changes very often) and should not be stored in the cache, false if not.

Return Value

null

at line 71
null update(string $config_name, mixed $config_value)

Update an existing config setting.

Parameters

string $config_name

The name of the config setting you would like to update

mixed $config_value

The value of the config setting

Return Value

null

Exceptions

exception

at line 93
null update_if_equals(string $compare, string $config_name, mixed $config_value)

Update a config setting if the first argument equal to the current config value

Parameters

string $compare

If equal to the current config value, will be updated to the new config value, otherwise not

string $config_name

The name of the config setting you would like to update

mixed $config_value

The value of the config setting

Return Value

null

Exceptions

exception

at line 110
null remove(string $config_name)

Remove an existing config setting.

Parameters

string $config_name

The name of the config setting you would like to remove

Return Value

null

at line 123
null reverse()

Reverse an original install action

First argument is the original call to the class (e.g. add, remove) After the first argument, send the original arguments to the function in the original call

Return Value

null