Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions libraries/legacy/error/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @var integer
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
const JERROR_ILLEGAL_OPTIONS = 1;

Expand All @@ -23,7 +23,7 @@
*
* @var integer
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
const JERROR_CALLBACK_NOT_CALLABLE = 2;

Expand All @@ -32,7 +32,7 @@
*
* @var integer
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
const JERROR_ILLEGAL_MODE = 3;

Expand All @@ -47,7 +47,7 @@
* - Stephan Schmidt <scst@php-tools.net>
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Will be removed without replacement
*/
abstract class JError
{
Expand All @@ -58,7 +58,7 @@ abstract class JError
* is present to allow an easy transition into exception handling for code written against the
* existing JError API in Joomla.
* @since 1.7
* @deprecated 1.7
* @deprecated 4.0
*/
public static $legacy = false;

Expand All @@ -67,7 +67,7 @@ abstract class JError
*
* @var array
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0
*/
protected static $levels = array(E_NOTICE => 'Notice', E_WARNING => 'Warning', E_ERROR => 'Error');

Expand All @@ -76,7 +76,7 @@ abstract class JError
*
* @var array
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0
*/
protected static $handlers = array(
E_NOTICE => array('mode' => 'ignore'),
Expand All @@ -89,7 +89,7 @@ abstract class JError
*
* @var JException[]
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0
*/
protected static $stack = array();

Expand All @@ -101,7 +101,7 @@ abstract class JError
* @return boolean True if argument is an exception, false otherwise.
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function isError($object)
{
Expand All @@ -118,7 +118,7 @@ public static function isError($object)
* @return JException|boolean Last JException object in the error stack or boolean false if none exist
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function getError($unset = false)
{
Expand Down Expand Up @@ -147,7 +147,7 @@ public static function getError($unset = false)
* @return JException[] Chronological array of errors that have been stored during script execution
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function getErrors()
{
Expand All @@ -164,7 +164,7 @@ public static function getErrors()
* @return void
*
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0
*/
public static function addToStack(JException &$e)
{
Expand All @@ -189,7 +189,7 @@ public static function addToStack(JException &$e)
* @return JException
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JException
*/
public static function raise($level, $code, $msg, $info = null, $backtrace = false)
Expand All @@ -210,7 +210,7 @@ public static function raise($level, $code, $msg, $info = null, $backtrace = fal
* @return JException A reference to the handled JException object
*
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0 Just throw an Exception
* @see JException
*/
public static function throwError(&$exception)
Expand Down Expand Up @@ -267,7 +267,7 @@ public static function throwError(&$exception)
* @return JException $error The thrown JException object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Just throw an Exception
* @see JError::raise()
*/
public static function raiseError($code, $msg, $info = null)
Expand All @@ -289,7 +289,7 @@ public static function raiseError($code, $msg, $info = null)
* @return JException $error The thrown JException object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Use \Joomla\CMS\Factory::getApplication()->enqueueMessage($msg, 'warning') when wou want to notify the UI
* @see JError::raise()
*/
public static function raiseWarning($code, $msg, $info = null)
Expand All @@ -311,7 +311,7 @@ public static function raiseWarning($code, $msg, $info = null)
* @return JException $error The thrown JException object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Use \Joomla\CMS\Factory::getApplication()->enqueueMessage($msg, 'notice') when wou want to notify the UI
* @see JError::raise()
*/
public static function raiseNotice($code, $msg, $info = null)
Expand All @@ -330,7 +330,7 @@ public static function raiseNotice($code, $msg, $info = null)
* @return array All error handling details
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function getErrorHandling($level)
{
Expand Down Expand Up @@ -364,7 +364,7 @@ public static function getErrorHandling($level)
* @return boolean|JException True on success or a JException object if failed.
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function setErrorHandling($level, $mode, $options = null)
{
Expand Down Expand Up @@ -435,7 +435,7 @@ public static function setErrorHandling($level, $mode, $options = null)
* @return void
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see set_error_handler
*/
public static function attachHandler()
Expand All @@ -451,7 +451,7 @@ public static function attachHandler()
* @return void
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see restore_error_handler
*/
public static function detachHandler()
Expand All @@ -476,7 +476,7 @@ public static function detachHandler()
* @return boolean True on success; false if the level already has been registered
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function registerErrorLevel($level, $name, $handler = 'ignore')
{
Expand All @@ -502,7 +502,7 @@ public static function registerErrorLevel($level, $name, $handler = 'ignore')
* @return string|boolean Human readable error level name or boolean false if it doesn't exist
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
*/
public static function translateErrorLevel($level)
{
Expand All @@ -526,7 +526,7 @@ public static function translateErrorLevel($level)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleIgnore(&$error, $options)
Expand All @@ -546,7 +546,7 @@ public static function handleIgnore(&$error, $options)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleEcho(&$error, $options)
Expand Down Expand Up @@ -622,7 +622,7 @@ public static function handleEcho(&$error, $options)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleVerbose(&$error, $options)
Expand Down Expand Up @@ -668,7 +668,7 @@ public static function handleVerbose(&$error, $options)
* @return void Calls die()
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleDie(&$error, $options)
Expand Down Expand Up @@ -709,7 +709,7 @@ public static function handleDie(&$error, $options)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleMessage(&$error, $options)
Expand All @@ -733,7 +733,7 @@ public static function handleMessage(&$error, $options)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleLog(&$error, $options)
Expand Down Expand Up @@ -770,7 +770,7 @@ public static function handleLog(&$error, $options)
* @return JException The exception object
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0
* @see JError::raise()
*/
public static function handleCallback(&$error, $options)
Expand All @@ -788,13 +788,13 @@ public static function handleCallback(&$error, $options)
* @return void
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Use \Joomla\CMS\Exception\ExceptionHandler::render() instead
*/
public static function customErrorPage($error)
{
JLog::add('JError::customErrorPage() is deprecated, use JErrorPage::render() instead.', JLog::WARNING, 'deprecated');

JErrorPage::render($error);
\Joomla\CMS\Exception\ExceptionHandler::render($error);
}

/**
Expand All @@ -808,7 +808,7 @@ public static function customErrorPage($error)
* @return void
*
* @since 1.5
* @deprecated 1.7
* @deprecated 4.0 Throw an Exception or enqueue the message to the application, eg. \Joomla\CMS\Factory::getApplication()->enqueueMessage($msg)
*/
public static function customErrorHandler($level, $msg)
{
Expand All @@ -825,12 +825,12 @@ public static function customErrorHandler($level, $msg)
* @return string Contents of the backtrace
*
* @since 1.6
* @deprecated 1.7
* @deprecated 4.0 Use JLayoutHelper::render('joomla.error.backtrace', array('backtrace' => $error->getTrace())) instead
*/
public static function renderBacktrace($error)
{
JLog::add('JError::renderBacktrace() is deprecated.', JLog::WARNING, 'deprecated');

return JLayoutHelper::render('joomla.error.backtrace', array('backtrace' => $error->getTrace()));
return \Joomla\CMS\Layout\LayoutHelper::render('joomla.error.backtrace', array('backtrace' => $error->getTrace()));
}
}