[ Index ]
 

Code source de Flux CMS 1.5

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/inc/ -> patErrorManager.php (sommaire)

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. $Id: patErrorManager.php 5019 2005-07-13 06:53:21Z chregu $

Poids: 697 lignes (18 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

patErrorManager:: (24 méthodes):
  isError()
  raiseError()
  raiseWarning()
  raiseNotice()
  raise()
  registerErrorLevel()
  setErrorHandling()
  getErrorHandling()
  translateErrorLevel()
  setErrorClass()
  addIgnore()
  removeIgnore()
  getIgnore()
  clearIgnore()
  pushExpect()
  popExpect()
  getExpect()
  clearExpect()
  handleErrorIgnore()
  handleErrorEcho()
  handleErrorVerbose()
  handleErrorDie()
  handleErrorTrigger()
  handleErrorCallback()


Classe: patErrorManager  - X-Ref

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.

isError( &$object )   X-Ref
method for checking whether the return value of a pat application method is a pat
error object.

param: mixed    &$object
return: boolean $result    True if argument is a patError-object, false otherwise.

raiseError( $code, $msg, $info = null )   X-Ref
wrapper for the {@link raise()} method where you do not have to specify the
error level - a {@link patError} object with error level E_ERROR will be returned.

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

raiseWarning( $code, $msg, $info = null )   X-Ref
wrapper for the {@link raise()} method where you do not have to specify the
error level - a {@link patError} object with error level E_WARNING will be returned.

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

raiseNotice( $code, $msg, $info = null )   X-Ref
wrapper for the {@link raise()} method where you do not have to specify the
error level - a {@link patError} object with error level E_NOTICE will be returned.

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

raise( $level, $code, $msg, $info = null )   X-Ref
creates a new patError object given the specified information.

param: 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.
param: string    $code    The application-internal error code for this error
param: string    $msg    The error message, which may also be shown the user if need be.
param: mixed    $info    Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
return: mixed    $error    The configured patError object or false if this error should be ignored

registerErrorLevel( $level, $name )   X-Ref
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.

param: integer    error level
param: string    human-readable name
return: boolean    true on success; false if the level already has been registered

setErrorHandling( $level, $mode, $options = null )   X-Ref
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

param: int        $level        The error level for which to set the error handling
param: string    $mode        The mode to use for the error handling.
param: mixed    $options    Optional: Any options needed for the given mode.
return: mixed    $result        True on success, or a patError object if failed.

getErrorHandling( $level )   X-Ref
retrieves the current error handling settings for the specified error level.

param: int        $level        The error level to retrieve. This can be any of PHP's own error levels, e.g. E_ALL, E_NOTICE...
return: array    $handling    All error handling details

translateErrorLevel( $level )   X-Ref
translate an error level

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

param: integer        error level
return: string        human-readable representation

setErrorClass( $name )   X-Ref
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)

param: string $name classname
return: boolean $result true on success

addIgnore( $codes )   X-Ref
add error codes to be ingored

param: mixed $codes either an array of error code or a single code that will be ignored in future
return: boolean $result true on success

removeIgnore( $codes )   X-Ref
removeIgnore

return: boolean $result true on success

getIgnore()   X-Ref
recieve all registerd error codes that will be ignored

return: array $codes list of error codes

clearIgnore()   X-Ref
empty list of errors to be ignored

return: boolean $result true on success

pushExpect( $codes )   X-Ref
add expected errors to stack

param: mixed $codes either an array of error code or a single code that will be ignored in future
return: boolean $result true on success

popExpect()   X-Ref
remove top of error-codes from stack

return: boolean $result true on success

getExpect()   X-Ref
recieve all registerd error codes that will be ignored

return: array $codes list of error codes

clearExpect()   X-Ref
empty list of errors to be ignored

return: boolean $result true on success

handleErrorIgnore( &$error, $options )   X-Ref
handleError: Ignore
Does nothing

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object

handleErrorEcho( &$error, $options )   X-Ref
handleError: Echo
display error message

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object

handleErrorVerbose( &$error, $options )   X-Ref
handleError: Verbose
display verbose output for developing purpose

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object

handleErrorDie( &$error, $options )   X-Ref
handleError: die
display error-message and die

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object

handleErrorTrigger( &$error, $options )   X-Ref
handleError: trigger
trigger php-error

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object

handleErrorCallback( &$error, $options )   X-Ref
handleError: callback
forward error to custom handler

param: object $error patError-Object
param: array $options options for handler
return: object $error error-object



Généré le : Wed Nov 21 13:08:55 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics