Gtk2_ExceptionDump
[ class tree: Gtk2_ExceptionDump ] [ index: Gtk2_ExceptionDump ] [ all elements ]

Class: Gtk2_ExceptionDump

Source Location: /Gtk2_ExceptionDump-1.1.1/Gtk2/ExceptionDump.php

Class Overview

GtkWindow
   |
   --Gtk2_ExceptionDump

Displays an Exception in a GtkWindow.


Author(s):

Version:

  • CVS: $Id$

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
Displays an Exception in a GtkWindow.

Supports PHP Exceptions and PEAR_Error objects.



[ Top ]


Class Variables

$exception =  null

[line 39]

The exception that is shown.

PEAR_Error or Exception.

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 54]

Gtk2_ExceptionDump __construct( mixed $exception, [string $title = null])

Creates a new ExceptionDump window.

You still need to show it and run the main loop.

The window can be closed, quitting the main loop and continuing running the program OR quitting the script with exit status 253

  • Access: public

Parameters:

mixed   $exception     Exception or PEAR_Error object
string   $title     The title for the window

[ Top ]

buildActionButtonBox   [line 305]

GtkButtonBox buildActionButtonBox( )

Returns the box with the Copy button.
  • Return: The button box.
  • Access: protected

[ Top ]

buildContinuationButtonBox   [line 279]

GtkButtonBox buildContinuationButtonBox( )

Returns the box with the Execute/Continue buttons.
  • Return: The button box.
  • Access: protected

[ Top ]

buildDialog   [line 246]

void buildDialog( )

Creates the dialog widgets.
  • Access: protected

[ Top ]

buildError   [line 326]

void buildError( mixed $exception)

Creates the error message that the object isn't an Exception or a PEAR_Error.
  • Access: protected

Parameters:

mixed   $exception     Some variable that isn't an Exception or a PEAR_Error object

[ Top ]

display   [line 75]

void display( mixed $exception, [string $title = null])

Creates a new ExceptionDump window, displays it and starts its own main loop.

The window can be closed, quitting the main loop and continuing running the program OR quitting the script with exit status 253

  • Access: public

Parameters:

mixed   $exception     Exception or PEAR_Error object
string   $title     (optional) The title for the window

[ Top ]

getExceptionAsString   [line 385]

void getExceptionAsString( mixed $exception)

Generates a string representation of the exception.
  • Access: protected

Parameters:

mixed   $exception     The exception to convert

[ Top ]

handlePhpError   [line 161]

void handlePhpError( int $errno, string $errstr, [string $errfile = null], [int $errline = null], [array $errcontext = array()])

Use Gtk2_ExceptionDump to display a PHP error.
  • Access: public

Parameters:

int   $errno     Contains the level of the error raised
string   $errstr     Error message
string   $errfile     Filename that the error was raised in
int   $errline     Line number the error was raised at
array   $errcontext     Array that points to the active symbol table at the point the error occurred. In other words, errcontext will contain an array of every variable that existed in the scope the error was triggered in.

[ Top ]

onContinue   [line 358]

void onContinue( )

Closes the window, quits the main loop and continues normal script execution.
  • Access: public

[ Top ]

onCopy   [line 372]

void onCopy( )

Copies the exception/error as string to the clipboard.
  • Access: public

[ Top ]

onQuit   [line 347]

void onQuit( )

Quits the php script with exit status 253.
  • Access: public

[ Top ]

setException   [line 198]

void setException( PEAR_Error|Exception $exception, [mixed $title = null])

Set the exception object.
  • Access: public

Parameters:

PEAR_Error|Exception   $exception     Exception to display
mixed   $title     Window title to use

[ Top ]

setTitle   [line 220]

void setTitle( PEAR_Error|Exception $exception, string $title)

Sets the title of the window.
  • Access: protected

Parameters:

PEAR_Error|Exception   $exception     Exception to display
string   $title     Window title to use

[ Top ]

setupAllHandlers   [line 139]

void setupAllHandlers( )

Sets up that all errors/exceptions are handled with Gtk2_ExceptionDump.

Calls setupExceptionHandler() and setupPearErrorHandler() internally.

  • Access: public

[ Top ]

setupExceptionHandler   [line 95]

void setupExceptionHandler( )

Sets up the PHP exception handler to call Gtk2_ExceptionDump::display() if an exception occurs.

This is the safest way to handle *all* uncaught exceptions with Gtk2_ExceptionDump. It handles "real" exceptions only, not PEAR_Errors.

Note that the "continue" button doesn't work anymore, since the exceptions are handled out of all user php code.

  • Access: public

[ Top ]

setupPearErrorHandler   [line 109]

void setupPearErrorHandler( )

Sets up the PEAR Exception handler to call Gtk2_ExceptionDump::display() if an PEAR_Error occurs.

While this catches *all* PEAR_Errors, it also catches the ones that are handled by php scripts.

  • Access: public

[ Top ]

setupPhpErrorHandler   [line 125]

void setupPhpErrorHandler( )

Sets the php error handler to use Gtk2_ExceptionDump.

All catchable PHP errors are displayed here.

Not all errors are handled, only the ones defined by error_reporting.

  • Access: public

[ Top ]


Documentation generated on Mon, 04 Nov 2013 14:30:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.