Utility functions

The audit-module allows panels to link extra functions via its registerFunction()-function. Some of the panels add methods during their initialisation that are then available during the application cycle.

Note: These functions are only available if the panel is actually added to the $panels-list (or to the $panelsMerge).

Usage is simply:

$module = Audit::getInstance();

(Or you can skip the adding a variable first and call the function directly on getInstace())


This panel adds a data()-function to link custom data to the entry.

$module->data($type, $data);

$type is usually a string, but it depends on what you need. $data is mixed.


The error panel provides 2 shortcut functions to log exceptions or messages to the entry:

$module->exception(Exception $exception)

This creates a new entry (if needed) and logs the $exception into it, including stack trace. It actually links to AuditError::log() but takes care of the AuditEntry parameter for you.

$module->errorMessage($message, $code = 0, $file = '', $line = 0, $trace = []);

Logs an error message into your entry. Same as exception(), but it links to AuditError::logMessage().


Depending on how you normally do your cURL requests you can use this panel in 2 different ways:

... // Create and configure curl handle
$curlResult = $module->curlExec($curlHandle, $startingUrl = null, $postData = null);


... // Create and configure curl handle
$module->curlBegin($curlHandle, $startingUrl = null, $postData = null);

For more information about the cURL-panel, see here