phpBB

Development Wiki

Difference between revisions of "Migrations/Tools/Config"

From phpBB Development Wiki

< Migrations‎ | Tools
(Created page with "The config tool helps adding, updating, and removing config settings. ==Add Config Setting== Add a new config setting<br /> <php>array('config.add', array(config name, config...")
 
m
 
Line 49: Line 49:
 
     );
 
     );
 
}</php>
 
}</php>
 +
 +
[[Category:Migrations]]

Latest revision as of 22:16, 13 January 2013

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']);
    
);
}