Overview

Packages

  • Geolib

Classes

  • Geo
  • GeoBody
  • GeoCell
  • GeoDebug
  • GeoHead
  • GeoHtml
  • GeoImg
  • GeoLink
  • GeoList
  • GeoSelect
  • GeoTable
  • GeoTag

Functions

  • b
  • div
  • geoAbsLink
  • geoAnchor
  • geoBody
  • geoButton
  • geoCell
  • geoCheckbox
  • geoDb
  • geoEnd
  • geoFieldSet
  • geoForm
  • geoHead
  • geoHidden
  • geoHtml
  • geoif
  • geoIList
  • geoImg
  • geoImgSubmit
  • geoInput
  • geoIsMultiArr
  • geoItem
  • geoJSLink
  • geoLabel
  • geoLegend
  • geolib_autoloader
  • geoLink
  • geoList
  • geoMultiArr
  • geoNoScript
  • geoPassword
  • geoPre
  • geoRadio
  • geoRadios
  • geoScript
  • geoSelect
  • geoStart
  • geoSubmit
  • geoTable
  • geoTabs
  • geoTag
  • geoText
  • geoTextArea
  • geoTrace
  • geoUpload
  • geovar
  • h1
  • h2
  • h3
  • h4
  • i
  • idiv
  • ispan
  • itag
  • p
  • span
  • Overview
  • Package
  • Class

Class GeoDebug

Class for static debugging functions

Package: Geolib
Category: Debugging
License: Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
Author: Original Author peter@geotonics.com
Version: Release: .1
Since: Class available since Release .1
Link: http://geotonics.com/#geolib
Located at classes/GeoDebug.php
Methods summary
public static
# init( )

Initialize Debug session

Initialize Debug session

public static void.
# customError( integer $errno, string $errstr, string $file, string $line )

Error handler function

Error handler function

Parameters

$errno
Error number
$errstr
Error string
$file
File where error takes place
$line
Line where error takes place

Returns

void.
public static void.
# debugging( boolean $end = null, boolean $temp = null )

This function is depreciated. Use Geodebug::debug() instead. Start or end debugging session by setting debugging flag

This function is depreciated. Use Geodebug::debug() instead. Start or end debugging session by setting debugging flag

Parameters

$end
End debugging session. Default is start debugging.
$temp
Start temporary debugging and reset debugging flag to original value upon output

Returns

void.
public static void.
# debug( boolean $start = null, boolean $temp = null )

Start or end debugging session by setting debugging flag

Start or end debugging session by setting debugging flag

Parameters

$start
Start debugging session. Default is end debugging
$temp
Start temporary debugging and reset debugging flag to original value upon output

Returns

void.
public static html
# vr( mixed $variable = "<span style='color:red'>DEBUG</span>", string $name = "Variable", boolean $isHtml = null )

Formats debugging variables for display

Formats debugging variables for display

Parameters

$variable
Any type of variable being debugged
$name
Name used for displaying debug variable
$isHtml
Display strings as html. Default displays html highlited tags.

Returns

html
debug content - is formatted with html
public static html
# db( mixed $variable = null, string $name = "debug", boolean $addBacktrace = null, boolean $return = null, boolean $noHighlight = null, boolean $always = true, integer $traceLevel = 0, text $userSessionName = "default" )

Adds content to debugging array

Adds content to debugging array

Parameters

$variable
Variable being debugged
$name
Name used for displaying debug variable
$addBacktrace
Determines whether to add backtrace to debug display
$return

Determines whether debugging content is displayed or saved. Default is saved.

$noHighlight
Display strings as html. Default displays html tags.
$always
Always debug, even when not in debugging mode
$traceLevel
Indicates which part of the backtrace array to display
$userSessionName
User session name

Returns

html
debug content is formatted with html
public static mixed
# isOn( mixed $true = true, mixed $false = null )

Return boolean or other content based on debug mode

Return boolean or other content based on debug mode

Parameters

$true
Value to be returned in debug mode. Default is true
$false
Value to be returned in non debug mode Default is null

Returns

mixed
result value
public static mixed
# reset( )

Reset Debug session: If temporary session is in progress, return to original debug setting, clean debug flags

Reset Debug session: If temporary session is in progress, return to original debug setting, clean debug flags

Returns

mixed
result value
public static void.
# saveDebugVars( boolean $startFromHere = null )

Debug variables are deleted by default when an html page is printed. If this is added to a page, debug variables are saved and added to the next page. (useful for ajax pages)

Debug variables are deleted by default when an html page is printed. If this is added to a page, debug variables are saved and added to the next page. (useful for ajax pages)

Parameters

$startFromHere
Determines whether to delete exising debugging at this point

Returns

void.
public static html
# req( boolean $print = null, boolean $always = null )

Collect $_POST, $_GET and $_FILES variables for display in debugging

Collect $_POST, $_GET and $_FILES variables for display in debugging

Parameters

$print
Determines whether to print or return result. Default is to return Result
$always
Determines whether to return results even when there are no values.

Returns

html
Display of results.
public static text|array
# trace( string $name = null, integer $level = 1, boolean $return = null, boolean $dontTraceFrom = null )

Creates full trace or selected trace level

Creates full trace or selected trace level

Parameters

$name
Identifies trace in debugging output
$level

Limits trace to a single level of backtrace Default is level 1 If true, return entire backtrace

$return
Determines whether to print out or add to debugging
$dontTraceFrom
Don't add a one line trace to the location of the calling function.

Returns

text|array
One line, or array if returning entire backtrace
public static string
# miniTrace( string $name = "miniTrace" )

Returns a simple one line trace to the next trace level

Returns a simple one line trace to the next trace level

Parameters

$name
Optional name to mark the trace with

Returns

string
one line trace
public static boolean
# logToFile( string $content, string $title = "log", boolean $alwaysLog = null, string $mode = "a", string $fileName = "geoLog.htm", string $theFile = null )

Writes or appends string to a file. Usefull for logging debugging variables.

Writes or appends string to a file. Usefull for logging debugging variables.

Parameters

$content
Content to write
$title
Name used to identify content in log file.
$alwaysLog
Always log to file. Default is to only log when in debug mode.
$mode

Mode indicator for PHP fwrite. Usually either "a" for append or "w" for write. Appends by default

$fileName
Name of file to write to.
$theFile
Name of file generating the log.

Returns

boolean
Indicates write success or failure
public static html
# vars( integer $height = null, integer $width = null, boolean $dontDelete = null, text $style = '', test $userSessionName = null )

Dump debug variables in $_SESSION['geolib']['isDebugSession']

Dump debug variables in $_SESSION['geolib']['isDebugSession']

Parameters

$height
Layout height
$width
Layout width
$dontDelete
Don't delete debug variables
$style
Added styles
$userSessionName
Name of user session

Returns

html
Debug variables are deleted by default after they are dumped
API documentation generated by ApiGen