Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

LoadConfig

LoadConfig

Loads and parses all asterisk configuration files into an associative array.

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

$file = FreePBX::LoadConfig()->loadConfig('modules.conf');

Alternatively you can load a file as so

$file = FreePBX::LoadConfig('modules.conf')

All data is accessed through public definitions:

$file->PlainConfig;
$file->BaseConfig;
$file->ProcessedConfig;

loadConfig()

/**
 * Loads and Processes a Configuration in the Asterisk Format
 *
 * This will attempt to load a file and then parse it
 * the file must be in the asterisk configuration file format!
 *
 * Note: this function does not return said file!
 *
 * @param string $file The basename of the file to load
 * @param string $hint The directory where the file lives
 * @return bool True if pass
 */
public function loadConfig($file = null, $hint = "/etc/asterisk") 

getRaw()

/**
 * Get Raw Contents of a Configuration File
 *
 * This will get the raw unprocessed contents of a configuration file
 *
 * Note: This will only work AFTER loadConfig has run
 *
 * @param string $file The basename of the file to load
 * @return string Raw Contents of said file
 */
public function getRaw($file = null)

getConfig()

/**
 * Get The Processed Contents of a Configuration File
 *
 * This will process and return a configuration file in the Asterisk Configuration
 * file format in a hashed format for processing
 *
 * @param string $file The basename of the file to load
 * @param string $hint The directory where the file lives
 * @param string $context The specific context to return, if not set then return all
 * @return array The hashed configuration file
 */
public function getConfig($file = null, $hint = "/etc/asterisk", $context = null)
  • No labels