/
ConfigFile
ConfigFile
Add and remove Entries from Asterisk Configuration Files.
This is an internal class and therefore should NOT be referenced externally. Please use the proper functionality from within your module. See FreePBX Big Module Object (BMO) for more information
$bmo = FreePBX::create();
$bmo->ConfigFile('modules.conf')->addEntry('modules',array('noload = pbx_gtkconsole.so')); |
addEntry()
/**
* Add Entry to Configuration file that has been loaded
* @param {string} $section The section we are adding the value to
* @param {mixed} $entry = null The value, can be array or string
*/
public function addEntry($section, $entry = null) {} |
Example
$bmo = FreePBX::create();
$bmo->ConfigFile('modules.conf')->addEntry('section',array('foo = bar')); |
Would Generate:
[section]
foo = bar |
$bmo = FreePBX::create();
$bmo->ConfigFile('modules.conf')->addEntry('foo','bar'); |
Would Generate:
[foo]
bar |
removeEntry()
/**
* Remove an entry from the write buffer
* @param {string} $section The section we are removing the value from
* @param {string} $key The key we are looking for
* @param {string} $val = null The value we are looking to remove, if blank then remove it regardless of value
*/
public function removeEntry($section, $key, $val = null) {} |