FreePBX Utilities Library.
Under /var/www/html/admin/libraries/utility.functions.php , we've got some methods useful they can be used any times.
function | Description |
---|---|
_bootstrap_parse_hooks() | Helper function to laod hooks for bootstrap_include_hooks() |
astdb_get($exclude = array()) | None |
astdb_put($astdb, $exclude = array()) | None |
bootstrap_include_hooks($hook_type, $module) | Run bootstrap hooks as provided by module.xml |
bytes2string($size) | Returns a rounded string representation of a byte size |
check_reload_needed($implicit_grant=false) | Check to see if Apply Changes/Need Reload flag has been set |
checkFreeSpace($allowedSpace) | None |
compress_framework_css() | None |
d($var, $tags = null) | None |
dbug() | FreePBX Debugging function |
dbug_printtree($dir, $indent = "\t") | Prints an array as a "tree" of data |
dbug_write($txt, $check = false) | None |
dbugcalltrace() | None |
die_freepbx($text, $extended_text="", $type="FATAL") | Throw FreePBX DIE Message |
download_file($file, $name = '', $type = '', $force_download = false) | Downloads a file to the browser (i.e. sends the file to the browser) |
edit_crontab($remove = '', $add = '') | function edit crontab |
error($text,$log=true) | None |
fatal($text,$log=true) | None |
file_get_contents_url($file_url) | like file_get_contents designed to work with url only, will try |
fpbx_ami_update($user=false, $pass=false, $writetimeout = false) | Update AMI credentials in manager.conf |
fpbx_pdfinfo($pdf) | Get data from a pdf file. Requires pdfinfo |
fpbx_which($app) | Returns the absolute path to a system application |
freepbx_debug($string, $option='', $filename='') | Log a debug message to a debug file (Depreciated) |
freepbx_error_handler($errno, $errstr, $errfile, $errline, $errcontext) | |
freepbx_filesize($file) | Return semi-accurate filesize for files |
freepbx_filetype($file) | Check filetype of files |
freepbx_log($level, $message) | FreePBX Logging facility to FILE or syslog |
freepbx_log_security($txt) | Log a message to the freepbx security file |
freepbxGetSanitizedRequest($definition = FILTER_SANITIZE_STRING, $add_empty = true) | Use filter_input_array |
generate_message_banner($message,$type='info',$details=array(),$link='',$closeable = false) | Generate Message Banner(s) |
get_framework_version($cached=true) | Get the FreePBX/Framework Version (Depreciated in favor of getversion) |
getCpuCount() | None |
getSystemMemInfo() | None |
getversion($cached=true) | Get the FreePBX/Framework Version |
IsAsteriskSupported($version) | None |
json_print_pretty($json, $indent = "\t") | this function can print a json object in a "pretty" |
needreload() | Tell the user we need to apply changes and reload Asterisk |
out($text,$log=true) | None |
outn($text,$log=true) | None |
rrmdir($dir) | Recursively remove a directory |
sanitize_outbound_callerid($cid) | None |
scandirr($dir, $absolute = false) | Function scandirr scans a directory just like scandir(), only recursively |
string2bytes($str, $type = '') | Returns a rounded byte size representation of a string |
varsub($string, $del = '$') | do variable substitution |
version_compare_freepbx($version1, $version2, $op = null) | version_compare that works with FreePBX version numbers |
version_min($origin, $list) | None |