Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

(no description)

File Size: 387 lines (11 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

t3lib_utility_Debug:: (9 methods):
  debug()
  prepareVariableForJavascript()
  convertVariableToString()
  debugInPopUpWindow()
  debugTrail()
  debugRows()
  ordinalValue()
  viewArray()
  printArray()


Class: t3lib_utility_Debug  - X-Ref

Class to handle debug

debug($var = '', $header = '', $group = 'Debug')   X-Ref
No description

prepareVariableForJavascript($string, $asObject)   X-Ref
Replaces special characters for the usage inside javascript

param: string $string
param: boolean $asObject
return: string

convertVariableToString($variable)   X-Ref
Converts a variable to a string

param: mixed $variable
return: string

debugInPopUpWindow($debugVariable, $header = 'Debug', $group = 'Debug')   X-Ref
Opens a debug message inside a popup window

param: mixed $debugVariable
param: string $header
param: string $group

debugTrail()   X-Ref
Displays the "path" of the function call stack in a string, using debug_backtrace

return: string

debugRows($rows, $header = '', $returnHTML = FALSE)   X-Ref
Displays an array as rows in a table. Useful to debug output like an array of database records.

param: mixed        Array of arrays with similar keys
param: string        Table header
param: boolean        If TRUE, will return content instead of echo'ing out.
return: void        Outputs to browser.

ordinalValue($string, $characters = 100)   X-Ref
Returns a string with a list of ascii-values for the first $characters characters in $string

param: string        String to show ASCII value for
param: integer        Number of characters to show
return: string        The string with ASCII values in separated by a space char.

viewArray($array_in)   X-Ref
Returns HTML-code, which is a visual representation of a multidimensional array
use t3lib_div::print_array() in order to print an array
Returns FALSE if $array_in is not an array

param: mixed        Array to view
return: string        HTML output

printArray($array_in)   X-Ref
Prints an array

param: mixed        Array to print visually (in a table).
return: void