phpBB

Development Wiki

Migrations/Tools/Config

From phpBB Development Wiki

< Migrations‎ | Tools
Revision as of 22:15, 13 January 2013 by Exreaction (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Add Config Setting

Add a new config setting

array('config.add', array(config nameconfig valueis dynamic (default: false) )),

Example

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

Update Config Setting

Update a config setting

array('config.update', array(config name, new config value)),

Example

public function update_data()
{
    return array(
         array(
'config.update', array('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

array('config.update_if_equals', array(compare toconfig name, new config value)),

Example

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

Delete Config Setting

Delete a config setting

array('config.remove', array(config name)),

Example

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