From 748fc425a4074752222c882c68bbd07d22e38c84 Mon Sep 17 00:00:00 2001 From: mattab Date: Fri, 19 Dec 2014 16:02:03 +1300 Subject: Rename Error to ErrorHandler --- console | 2 +- core/Error.php | 8 ++++---- core/Log/Processor/ExceptionToTextProcessor.php | 4 ++-- core/Tracker.php | 2 +- core/dispatch.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/console b/console index 1b4d7c7e08..b75eb2d1ec 100755 --- a/console +++ b/console @@ -27,7 +27,7 @@ if (!Piwik\Common::isPhpCliMode()) { if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) { require_once PIWIK_INCLUDE_PATH . '/core/Error.php'; - \Piwik\Error::setErrorHandler(); + \Piwik\ErrorHandler::setErrorHandler(); require_once PIWIK_INCLUDE_PATH . '/core/ExceptionHandler.php'; \Piwik\ExceptionHandler::setUp(); } diff --git a/core/Error.php b/core/Error.php index f153a22335..2bd22f4002 100644 --- a/core/Error.php +++ b/core/Error.php @@ -13,7 +13,7 @@ use Piwik\Exception\ErrorException; /** * Piwik's error handler function. */ -class Error +class ErrorHandler { /** * Returns a string description of a PHP error number. @@ -61,7 +61,7 @@ class Error public static function setErrorHandler() { - set_error_handler(array('Piwik\Error', 'errorHandler')); + set_error_handler(array('Piwik\ErrorHandler', 'errorHandler')); } public static function errorHandler($errno, $errstr, $errfile, $errline) @@ -105,7 +105,7 @@ class Error "%s(%d): %s - %s - Piwik " . (class_exists('Piwik\Version') ? Version::VERSION : '') . " - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)", $errfile, $errline, - Error::getErrNoString($errno), + ErrorHandler::getErrNoString($errno), $errstr ); } @@ -114,7 +114,7 @@ class Error { $trace = Log::$debugBacktraceForTests ?: $trace; - $message = Error::getErrNoString($errno) . ' - ' . $errstr; + $message = ErrorHandler::getErrNoString($errno) . ' - ' . $errstr; $html = "There is an error. Please report the message (Piwik " . (class_exists('Piwik\Version') ? Version::VERSION : '') . ") and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

diff --git a/core/Log/Processor/ExceptionToTextProcessor.php b/core/Log/Processor/ExceptionToTextProcessor.php index ea3e3aec45..c3d51ae9e5 100644 --- a/core/Log/Processor/ExceptionToTextProcessor.php +++ b/core/Log/Processor/ExceptionToTextProcessor.php @@ -8,7 +8,7 @@ namespace Piwik\Log\Processor; -use Piwik\Error; +use Piwik\ErrorHandler; use Piwik\Log; /** @@ -45,7 +45,7 @@ class ExceptionToTextProcessor private function getMessage(\Exception $exception) { if ($exception instanceof \ErrorException) { - return Error::getErrNoString($exception->getSeverity()) . ' - ' . $exception->getMessage(); + return ErrorHandler::getErrNoString($exception->getSeverity()) . ' - ' . $exception->getMessage(); } return $exception->getMessage(); diff --git a/core/Tracker.php b/core/Tracker.php index fae00a57ef..69350ba82e 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -76,7 +76,7 @@ class Tracker \Piwik\FrontController::createConfigObject(); if ($this->isDebugModeEnabled()) { - Error::setErrorHandler(); + ErrorHandler::setErrorHandler(); ExceptionHandler::setUp(); Common::printDebug("Debug enabled - Input parameters: "); diff --git a/core/dispatch.php b/core/dispatch.php index d842b6a727..803995650f 100644 --- a/core/dispatch.php +++ b/core/dispatch.php @@ -8,7 +8,7 @@ * @package Piwik */ -use Piwik\Error; +use Piwik\ErrorHandler; use Piwik\ExceptionHandler; use Piwik\FrontController; use Piwik\Plugin\ControllerAdmin as PluginControllerAdmin; @@ -17,7 +17,7 @@ PluginControllerAdmin::disableEacceleratorIfEnabled(); if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) { require_once PIWIK_INCLUDE_PATH . '/core/Error.php'; - Error::setErrorHandler(); + ErrorHandler::setErrorHandler(); require_once PIWIK_INCLUDE_PATH . '/core/ExceptionHandler.php'; ExceptionHandler::setUp(); } -- cgit v1.2.3