fititnt - Especialista e Desenvolvedor Joomla! Visit fititnt.org, and look for some extension or more Joomla Framework info patError
[ class tree: patError ] [ index: patError ] [ all elements ]

Class: patErrorManager

Source Location: /libraries/pattemplate/patErrorManager.php

Class patErrorManager

Class Overview

patErrorManager main error management class used by pat tools for the application-internal error management. Creates patError objects for any errors for precise error management.

Located in /libraries/pattemplate/patErrorManager.php [line 81]



		
				Author(s):
		
		
		
Information Tags:
Version:  0.3
Link:  http://www.php-tools.net
Todo:  implement expectError() to ignore an error with a certain code only once.
Todo:  implement ignoreError() to ignore errrors with a certain code
License:  LGPL

Methods

[ Top ]
Method Summary
static boolean   addIgnore()   add error codes to be ingored
static boolean   clearExpect()   empty list of errors to be ignored
static boolean   clearIgnore()   empty list of errors to be ignored
static array   getExpect()   recieve all registerd error codes that will be ignored
static array   getIgnore()   recieve all registerd error codes that will be ignored
static boolean   isError()   method for checking whether the return value of a pat application method is a pat error object.
static boolean   popExpect()   remove top of error-codes from stack
static boolean   pushExpect()   add expected errors to stack
static object   &raiseError()   wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_ERROR will be returned.
static object   &raiseNotice()   wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_NOTICE will be returned.
static object   &raiseWarning()   wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_WARNING will be returned.
static boolean   removeIgnore()   removeIgnore
static mixed   setErrorHandling()   sets the way the patErrorManager will handle teh different error levels. Use this if you want to override the default settings.
array   getErrorHandling()   retrieves the current error handling settings for the specified error level.
object   &handleErrorCallback()   handleError: callback forward error to custom handler
object   &handleErrorDie()   handleError: die display error-message and die
object   &handleErrorEcho()   handleError: Echo display error message
object   &handleErrorIgnore()   handleError: Ignore Does nothing
object   &handleErrorTrigger()   handleError: trigger trigger php-error
object   &handleErrorVerbose()   handleError: Verbose display verbose output for developing purpose
mixed   &raise()   creates a new patError object given the specified information.
boolean   registerErrorLevel()   register a new error level
boolean   setErrorClass()   setErrorClass
string   translateErrorLevel()   translate an error level

[ Top ]
Methods
static method addIgnore  [line 407]

  static boolean addIgnore( mixed $codes  )

add error codes to be ingored

Parameters:
mixed   $codes:  either an array of error code or a single code that will be ignored in future

API Tags:
Return:  true on success
Access:  public


[ Top ]
static method clearExpect  [line 534]

  static boolean clearExpect( )

empty list of errors to be ignored


API Tags:
Return:  true on success
Access:  public


[ Top ]
static method clearIgnore  [line 471]

  static boolean clearIgnore( )

empty list of errors to be ignored


API Tags:
Return:  true on success
Access:  public


[ Top ]
static method getExpect  [line 522]

  static array getExpect( )

recieve all registerd error codes that will be ignored


API Tags:
Return:  list of error codes
Access:  public


[ Top ]
static method getIgnore  [line 459]

  static array getIgnore( )

recieve all registerd error codes that will be ignored


API Tags:
Return:  list of error codes
Access:  public


[ Top ]
static method isError  [line 92]

  static boolean isError( mixed &$object  )

method for checking whether the return value of a pat application method is a pat error object.

Parameters:
mixed   &$object: 

API Tags:
Return:  True if argument is a patError-object, false otherwise.
Access:  public


[ Top ]
static method popExpect  [line 504]

  static boolean popExpect( )

remove top of error-codes from stack


API Tags:
Return:  true on success
Access:  public


[ Top ]
static method pushExpect  [line 485]

  static boolean pushExpect( mixed $codes  )

add expected errors to stack

Parameters:
mixed   $codes:  either an array of error code or a single code that will be ignored in future

API Tags:
Return:  true on success
Access:  public


[ Top ]
static method raiseError  [line 122]

  static object &raiseError( string $code, string $msg, [mixed $info = null]  )

wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_ERROR will be returned.

Parameters:
string   $code:  The application-internal error code for this error
string   $msg:  The error message, which may also be shown the user if need be.
mixed   $info:  Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

API Tags:
Return:  The configured patError object
See:  patError
See:  patErrorManager::raise()
Access:  public


[ Top ]
static method raiseNotice  [line 158]

  static object &raiseNotice( string $code, string $msg, [mixed $info = null]  )

wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_NOTICE will be returned.

Parameters:
string   $code:  The application-internal error code for this error
string   $msg:  The error message, which may also be shown the user if need be.
mixed   $info:  Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

API Tags:
Return:  The configured patError object
See:  patError
See:  patErrorManager::raise()
Access:  public


[ Top ]
static method raiseWarning  [line 140]

  static object &raiseWarning( string $code, string $msg, [mixed $info = null]  )

wrapper for the raise() method where you do not have to specify the error level - a patError object with error level E_WARNING will be returned.

Parameters:
string   $code:  The application-internal error code for this error
string   $msg:  The error message, which may also be shown the user if need be.
mixed   $info:  Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

API Tags:
Return:  The configured patError object
See:  patError
See:  patErrorManager::raise()
Access:  public


[ Top ]
static method removeIgnore  [line 428]

  static boolean removeIgnore( $codes  )

removeIgnore

Parameters:
   $codes: 

API Tags:
Return:  true on success
Access:  public


[ Top ]
static method setErrorHandling  [line 280]

  static mixed setErrorHandling( int $level, string $mode, [mixed $options = null]  )

sets the way the patErrorManager will handle teh different error levels. Use this if you want to override the default settings.

Error handling modes:

  • ignore
  • trigger
  • verbose
  • echo
  • callback
  • die
You may also set the error handling for several modes at once using PHP's bit operations. Examples:
  • E_ALL = Set the handling for all levels
  • E_ERROR | E_WARNING = Set the handling for errors and warnings
  • E_ALL ^ E_ERROR = Set the handling for all levels except errors

Parameters:
int   $level:  The error level for which to set the error handling
string   $mode:  The mode to use for the error handling.
mixed   $options:  Optional: Any options needed for the given mode.

API Tags:
Return:  True on success, or a patError object if failed.
See:  patErrorManager::getErrorHandling()
Access:  public


[ Top ]
getErrorHandling  [line 352]

  array getErrorHandling( int $level  )

retrieves the current error handling settings for the specified error level.

Parameters:
int   $level:  The error level to retrieve. This can be any of PHP's own error levels, e.g. E_ALL, E_NOTICE...

API Tags:
Return:  All error handling details
Access:  public


[ Top ]
handleErrorCallback  [line 703]

  object &handleErrorCallback( &$error, array $options, object $error  )

handleError: callback forward error to custom handler

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
handleErrorDie  [line 637]

  object &handleErrorDie( &$error, array $options, object $error  )

handleError: die display error-message and die

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
handleErrorEcho  [line 565]

  object &handleErrorEcho( &$error, array $options, object $error  )

handleError: Echo display error message

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
handleErrorIgnore  [line 550]

  object &handleErrorIgnore( &$error, array $options, object $error  )

handleError: Ignore Does nothing

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
handleErrorTrigger  [line 671]

  object &handleErrorTrigger( &$error, array $options, object $error  )

handleError: trigger trigger php-error

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
handleErrorVerbose  [line 599]

  object &handleErrorVerbose( &$error, array $options, object $error  )

handleError: Verbose display verbose output for developing purpose

Parameters:
object   $error:  patError-Object
array   $options:  options for handler
   &$error: 

API Tags:
Return:  error-object
See:  patErrorManager::raise()
Access:  private


[ Top ]
raise  [line 176]

  mixed &raise( int $level, string $code, string $msg, [mixed $info = null]  )

creates a new patError object given the specified information.

Parameters:
int   $level:  The error level - use any of PHP's own error levels for this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE.
string   $code:  The application-internal error code for this error
string   $msg:  The error message, which may also be shown the user if need be.
mixed   $info:  Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

API Tags:
Return:  The configured patError object or false if this error should be ignored
See:  patError
Access:  public

Information Tags:
Todo:  implement 'simple' mode that returns just false (BC for patConfiguration)
Todo:  either remove HTML tags and entities from output or test for enviroment!!! in shell is ugly!

[ Top ]
registerErrorLevel  [line 243]

  boolean registerErrorLevel( integer $level, string $name  )

register a new error level

This allows you to add custom error levels to the built-in

  • E_NOTICE
  • E_WARNING
  • E_NOTICE
You may use this level in subsequent calls to raise(). Error handling will be set to 'ignore' for the new level, you may change it by using setErrorHandling().

You could be using PHP's predefined constants for error levels or any other integer value.

Parameters:
integer   $level:  error level
string   $name:  human-readable name

API Tags:
Return:  true on success; false if the level already has been registered
See:  patErrorManager::raise(), patErrorManager::setErrorHandling()
Access:  public

Information Tags:
Link:  http://www.php.net/manual/en/function.error-reporting.php

[ Top ]
setErrorClass  [line 387]

  boolean setErrorClass( string $name  )

setErrorClass

In order to autoload this class, the filename containing that class must be named like the class itself; with an appending ".php". Although the file must be stored in the same directory as patErrorManager.php (this file)

Parameters:
string   $name:  classname

API Tags:
Return:  true on success
Access:  public


[ Top ]
translateErrorLevel  [line 367]

  string translateErrorLevel( integer $level  )

translate an error level

returns the human-readable name for an error level, e.g. E_ERROR will be translated to 'Error'.

Parameters:
integer   $level:  error level

API Tags:
Return:  human-readable representation
Access:  public


[ Top ]

The site fititnt.org is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. If you are looking for official documentation, visit api.joomla.org and docs.joomla.org.
Documentation generated on Mon, 26 Oct 2009 22:14:36 -0200 by phpDocumentor 1.4.3