Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe JError

Fonctions membres publiques statiques

static isError ($object)
 
static getError ($unset=false)
 
static getErrors ()
 
static addToStack (JException $e)
 
static raise ($level, $code, $msg, $info=null, $backtrace=false)
 
static throwError (&$exception)
 
static raiseError ($code, $msg, $info=null)
 
static raiseWarning ($code, $msg, $info=null)
 
static raiseNotice ($code, $msg, $info=null)
 
static getErrorHandling ($level)
 
static setErrorHandling ($level, $mode, $options=null)
 
static attachHandler ()
 
static detachHandler ()
 
static registerErrorLevel ($level, $name, $handler='ignore')
 
static translateErrorLevel ($level)
 
static handleIgnore (&$error, $options)
 
static handleEcho (&$error, $options)
 
static handleVerbose (&$error, $options)
 
static handleDie (&$error, $options)
 
static handleMessage (&$error, $options)
 
static handleLog (&$error, $options)
 
static handleCallback (&$error, $options)
 
static customErrorPage ($error)
 
static customErrorHandler ($level, $msg)
 
static renderBacktrace ($error)
 

Attributs publics statiques

static $legacy = false
 

Attributs protégés statiques

static $levels = array(E_NOTICE => 'Notice', E_WARNING => 'Warning', E_ERROR => 'Error')
 
static $handlers
 
static $stack = array()
 

Description détaillée

Error Handling Class

This class is inspired in design and concept by patErrorManager http://www.php-tools.net

patErrorManager contributors include:

Depuis
1.5
Obsolète:
4.0 Will be removed without replacement

Documentation des fonctions membres

◆ addToStack()

static addToStack ( JException  $e)
static

Method to add non-JError thrown JExceptions to the JError stack for debugging purposes

Paramètres
JException$eAdd an exception to the stack.
Renvoie
void
Depuis
1.6
Obsolète:
4.0

Référencé par JException\__construct().

◆ attachHandler()

static attachHandler ( )
static

Method that attaches the error handler to JError

Renvoie
void
Depuis
1.5
Obsolète:
4.0
Voir également
set_error_handler

◆ customErrorHandler()

static customErrorHandler (   $level,
  $msg 
)
static

Display a message to the user

Paramètres
integer$levelThe 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$msgError message, shown to user if need be.
Renvoie
void
Depuis
1.5
Obsolète:
4.0 Throw an Exception or enqueue the message to the application, eg. ::getApplication()->enqueueMessage($msg)

◆ customErrorPage()

static customErrorPage (   $error)
static

Display a custom error page and exit gracefully

Paramètres
JException$errorException object
Renvoie
void
Depuis
1.5
Obsolète:
4.0 Use ::render() instead

Références ExceptionHandler\render().

Référencé par PlgSystemLogout\handleError().

◆ detachHandler()

static detachHandler ( )
static

Method that detaches the error handler from JError

Renvoie
void
Depuis
1.5
Obsolète:
4.0
Voir également
restore_error_handler

◆ getError()

static getError (   $unset = false)
static

Method for retrieving the last exception object in the error stack

Paramètres
boolean$unsetTrue to remove the error from the stack.
Renvoie
JException|boolean Last JException object in the error stack or boolean false if none exist
Depuis
1.5
Obsolète:
4.0

Référencé par PlgSystemDebug\displayErrors().

◆ getErrorHandling()

static getErrorHandling (   $level)
static

Method to get the current error handler settings for a specified error level.

Paramètres
integer$levelThe error level to retrieve. This can be any of PHP's own error levels, e.g. E_ALL, E_NOTICE...
Renvoie
array All error handling details
Depuis
1.5
Obsolète:
4.0

◆ getErrors()

static getErrors ( )
static

Method for retrieving the exception stack

Renvoie
JException[] Chronological array of errors that have been stored during script execution
Depuis
1.5
Obsolète:
4.0

Référencé par PlgSystemDebug\onAfterRespond().

◆ handleCallback()

static handleCallback ( $error,
  $options 
)
static

Callback error handler

  • Send the error object to a callback method for error handling
Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

Références $options.

◆ handleDie()

static handleDie ( $error,
  $options 
)
static

Die error handler

  • Echos the error message to output and then dies
Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
void Calls die()
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

◆ handleEcho()

static handleEcho ( $error,
  $options 
)
static

Echo error handler

  • Echos the error message to output
Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

Références $i, et JDEBUG.

◆ handleIgnore()

static handleIgnore ( $error,
  $options 
)
static

Ignore error handler

  • Ignores the error
Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

◆ handleLog()

static handleLog ( $error,
  $options 
)
static

Log error handler Logs the error message to a system log file

Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

Références $options, et null.

◆ handleMessage()

static handleMessage ( $error,
  $options 
)
static

Message error handler Enqueues the error message into the system queue

Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

Références $type.

◆ handleVerbose()

static handleVerbose ( $error,
  $options 
)
static

Verbose error handler

  • Echos the error message to output as well as related info
Paramètres
JException&$errorException object to handle
array$optionsHandler options
Renvoie
JException The exception object
Depuis
1.5
Obsolète:
4.0
Voir également
JError::raise()

Références $info, et null.

◆ isError()

static isError (   $object)
static

Method to determine if a value is an exception object.

Paramètres
mixed$objectObject to check.
Renvoie
boolean True if argument is an exception, false otherwise.
Depuis
1.5
Obsolète:
4.0

◆ raise()

static raise (   $level,
  $code,
  $msg,
  $info = null,
  $backtrace = false 
)
static

Create a new JException object given the passed arguments

Paramètres
integer$levelThe 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$codeThe application-internal error code for this error
string$msgThe error message, which may also be shown the user if need be.
mixed$infoOptional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
boolean$backtraceAdd a stack backtrace to the exception.
Renvoie
JException
Depuis
1.5
Obsolète:
4.0
Voir également
JException

Références $info.

◆ raiseError()

static raiseError (   $code,
  $msg,
  $info = null 
)
static

Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true.

Paramètres
string$codeThe application-internal error code for this error
string$msgThe error message, which may also be shown the user if need be.
mixed$infoOptional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
Renvoie
JException $error The thrown JException object
Depuis
1.5
Obsolète:
4.0 Just throw an Exception
Voir également
JError::raise()

Références $info.

Référencé par UsersControllerRegistration\activate(), UsersControllerGroups\checkin(), BannersModelBanner\click(), CategoryView\commonCategoryDisplay(), UsersControllerGroups\delete(), UsersControllerLevel\delete(), ContenthistoryViewPreview\display(), MessagesViewMessages\display(), UsersViewRemind\display(), UsersViewReset\display(), UsersViewLogin\display(), UsersViewRegistration\display(), UsersViewProfile\display(), NewsfeedsViewNewsfeeds\display(), MenusViewItem\display(), ContentController\display(), FinderViewSearch\display(), FinderViewIndex\display(), MailtoViewMailto\getData(), ContentModelArticle\getItem(), NewsfeedsModelNewsfeed\getItem(), ContactModelContact\getItem(), TagsModelTag\getItem(), ModPopularHelper\getList(), ModLatestHelper\getList(), TagsModelTag\hit(), BannersModelBanners\impress(), UsersRouterRulesLegacy\parse(), ContentRouterRulesLegacy\parse(), UsersControllerGroups\publish(), FOFIntegrationJoomlaPlatform\raiseError(), UsersControllerRegistration\register(), UsersControllerGroups\reorder(), MessagesControllerConfig\save(), MenusControllerMenu\save(), UsersControllerProfile\save(), MenusControllerItem\save(), UsersControllerGroups\saveorder(), MailtoController\send(), et ContactControllerContact\submit().

◆ raiseNotice()

static raiseNotice (   $code,
  $msg,
  $info = null 
)
static

Wrapper method for the raise() method with predefined error level of E_NOTICE and backtrace set to false.

Paramètres
string$codeThe application-internal error code for this error
string$msgThe error message, which may also be shown the user if need be.
mixed$infoOptional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
Renvoie
JException $error The thrown JException object
Depuis
1.5
Obsolète:
4.0 Use ::getApplication()->enqueueMessage($msg, 'notice') when wou want to notify the UI
Voir également
JError::raise()

Références $info.

Référencé par admin_postinstall_eaccelerator_action(), JFormFieldUserMessages\getGroups(), FOFFormFieldRules\getInput25(), InstallerModelManage\publish(), CategoriesModelCategory\save(), MenusModelItem\save(), MailtoController\send(), Mail\Send(), et MenusModelItem\setHome().

◆ raiseWarning()

static raiseWarning (   $code,
  $msg,
  $info = null 
)
static

Wrapper method for the raise() method with predefined error level of E_WARNING and backtrace set to false.

Paramètres
string$codeThe application-internal error code for this error
string$msgThe error message, which may also be shown the user if need be.
mixed$infoOptional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
Renvoie
JException $error The thrown JException object
Depuis
1.5
Obsolète:
4.0 Use ::getApplication()->enqueueMessage($msg, 'warning') when wou want to notify the UI
Voir également
JError::raise()

Références $info.

Référencé par JoomlaupdateControllerUpdate\_applyCredentials(), PlgContentJoomla\_countItemsInCategory(), PlgContentJoomla\_countItemsInChildren(), InstallerModelInstall\_getPackageFromFolder(), InstallerModelInstall\_getPackageFromUpload(), InstallerModelInstall\_getPackageFromUrl(), JArchiveTar\_getTarInfo(), RedirectControllerLinks\activate(), UsersControllerUsers\activate(), UsersModelUser\activate(), ModulesControllerModule\add(), JoomlaupdateModelDefault\applyUpdateSite(), MediaControllerFile\authoriseUser(), UsersModelUser\block(), UsersControllerUsers\changeBlock(), JHtmlBanner\clientlist(), MediaControllerFolder\create(), ContenthistoryControllerHistory\delete(), MediaControllerFolder\delete(), UsersControllerLevel\delete(), TemplatesModelStyle\delete(), BannersModelTracks\delete(), MediaControllerFile\delete(), UsersModelGroup\delete(), ModulesModelModule\delete(), UsersModelUser\delete(), MediaViewMediaList\display(), ContentViewArticle\display(), ContentViewForm\display(), NewsfeedsViewNewsfeed\display(), ContentViewFeatured\display(), ContactViewContact\display(), ContactViewFeatured\display(), TemplatesControllerStyles\duplicate(), ModulesControllerModules\duplicate(), ModulesModelModule\duplicate(), RedirectControllerLinks\duplicateUrls(), JArchiveTar\extract(), PluginsHelper\folderOptions(), ConfigModelModules\getActivePositions(), BannersHelper\getClientOptions(), RedisStorage\getConnection(), FieldsHelper\getFieldsPluginId(), FinderHelper\getFinderPluginId(), JFormFieldModal_Article\getInput(), JFormFieldModal_Newsfeed\getInput(), JFormFieldModal_Contact\getInput(), JFormFieldModal_Category\getInput(), JFormFieldModal_Menu\getInput(), AssociationsHelper\getLanguagefilterPluginId(), MenusHelper\getMenuLinks(), JFormFieldMenuParent\getOptions(), JFormFieldNewsfeeds\getOptions(), JFormFieldCategoryParent\getOptions(), JFormFieldMenuOrdering\getOptions(), JFormFieldContentTypes\getOptions(), JFormFieldCategoryEdit\getOptions(), ModulesHelper\getPositions(), RedirectHelper\getRedirectPluginId(), InstallerModelUpdate\install(), ContenthistoryControllerHistory\keep(), JHtmlFinder\mapslist(), PlgContentJoomla\onContentBeforeDelete(), PlgUserContactCreator\onUserAfterSave(), ModulesControllerModule\orderPosition(), JHtmlModules\positionList(), FOFUtilsInstallscript\preflight(), InstallerModelManage\publish(), MenusModelItem\publish(), JArchiveBzip2\raiseWarning(), JArchiveGzip\raiseWarning(), JArchiveZip\raiseWarning(), MenusModelItem\rebuild(), InstallerModelManage\remove(), SearchControllerSearches\reset(), MenusControllerMenus\resync(), ModulesModelModule\save(), UsersModelLevels\saveorder(), MailtoController\send(), ClientHelper\setCredentialsFromRequest(), TemplatesControllerStyles\setDefault(), MenusControllerItems\setDefault(), MenusModelItem\setHome(), ContentModelArticle\storeVote(), ContactControllerContact\submit(), LanguagesModelInstalled\switchAdminLanguage(), TemplatesControllerStyles\unsetDefault(), et MediaControllerFile\upload().

◆ registerErrorLevel()

static registerErrorLevel (   $level,
  $name,
  $handler = 'ignore' 
)
static

Method to register a new error level for handling errors

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

  • E_NOTICE
  • E_WARNING
  • E_NOTICE
Paramètres
integer$levelError level to register
string$nameHuman readable name for the error level
string$handlerError handler to set for the new error level [optional]
Renvoie
boolean True on success; false if the level already has been registered
Depuis
1.5
Obsolète:
4.0

Références $name.

◆ renderBacktrace()

static renderBacktrace (   $error)
static

Render the backtrace

Paramètres
Exception$errorThe error
Renvoie
string Contents of the backtrace
Depuis
1.6
Obsolète:
4.0 Use JLayoutHelper::render('joomla.error.backtrace', array('backtrace' => $error->getTrace())) instead

◆ setErrorHandling()

static setErrorHandling (   $level,
  $mode,
  $options = null 
)
static

Method to set the way the JError will handle different error levels. Use this if you want to override the default settings.

Error handling modes:

  • ignore
  • echo
  • verbose
  • die
  • message
  • log
  • callback

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ètres
integer$levelThe error level for which to set the error handling
string$modeThe mode to use for the error handling.
mixed$optionsOptional: Any options needed for the given mode.
Renvoie
boolean|JException True on success or a JException object if failed.
Depuis
1.5
Obsolète:
4.0

Références $function, $mode, $options, $tmp, JERROR_CALLBACK_NOT_CALLABLE, JERROR_ILLEGAL_MODE, JERROR_ILLEGAL_OPTIONS, et null.

Référencé par PlgSystemLogout\__construct(), PlgSystemRedirect\__construct(), et FOFPlatform\setErrorHandling().

◆ throwError()

static throwError ( $exception)
static

Throw an error

Paramètres
JException&$exceptionAn exception to throw.
Renvoie
JException A reference to the handled JException object
Depuis
1.6
Obsolète:
4.0 Just throw an Exception
Voir également
JException

Références $function.

◆ translateErrorLevel()

static translateErrorLevel (   $level)
static

Translate an error level integer to a human readable string e.g. E_ERROR will be translated to 'Error'

Paramètres
integer$levelError level to translate
Renvoie
string|boolean Human readable error level name or boolean false if it doesn't exist
Depuis
1.5
Obsolète:
4.0

Documentation des champs

◆ $handlers

$handlers
staticprotected
Valeur initiale :
= array(
E_NOTICE => array('mode' => 'ignore'),
E_WARNING => array('mode' => 'ignore'),
E_ERROR => array('mode' => 'ignore'),
)

◆ $legacy

$legacy = false
static

◆ $levels

$levels = array(E_NOTICE => 'Notice', E_WARNING => 'Warning', E_ERROR => 'Error')
staticprotected

◆ $stack

$stack = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :