Config Tool

The config tool helps adding, updating, and removing config settings.

Add Config Setting

Add a new config setting

['config.add', [config name, config value, is dynamic (default: false) ]],

Example

public function update_data()
{
    return [
         ['config.add', ['foo', 'bar']], // $config['foo'] = 'bar';
         ['config.add', ['foo2', 1, true]], // $config['foo2'] = '1'; Dynamic, do not cache
    ];
}

Update Config Setting

Update a config setting

['config.update', [config name, new config value]],

Example

public function update_data()
{
    return [
         ['config.update', ['foo', 'bar']], // $config['foo'] = 'bar';
    ];
}

Update if current value equals specific value

Update a config setting if the current config value is equal to a specified value

['config.update_if_equals', [compare to, config name, new config value]],

Example

public function update_data()
{
    return [
         ['config.update_if_equals', ['bar', 'foo', 'bar2']], // if ($config['foo'] == 'bar') { $config['foo'] = 'bar2'; }
    ];
}

Delete Config Setting

Delete a config setting

['config.remove', [config name]],

Example

public function update_data()
{
    return [
         ['config.remove', ['foo']], // unset($config['foo']);
    ];
}