getTraceAsString()); throw new ErrorException($message, 0, $errno, $errfile, $errline); break; case E_WARNING: case E_NOTICE: case E_USER_WARNING: case E_USER_NOTICE: case E_STRICT: case E_RECOVERABLE_ERROR: case E_DEPRECATED: case E_USER_DEPRECATED: default: try { Log::warning(self::createLogMessage($errno, $errstr, $errfile, $errline)); } catch (\Exception $ex) { // ignore (it's possible for this to happen if the StaticContainer hasn't been created yet) } break; } } private static function createLogMessage($errno, $errstr, $errfile, $errline) { return sprintf( "%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, ErrorHandler::getErrNoString($errno), $errstr ); } private static function getHtmlMessage($errno, $errstr, $errfile, $errline, $trace) { $trace = Log::$debugBacktraceForTests ?: $trace; $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 firit might have been reported already!).

"; $html .= "

{$message} in {$errfile}"; $html .= " on line {$errline}

"; $html .= "Backtrace:
";
        $html .= str_replace("\n", "\n", $trace);
        $html .= "
"; return $html; } }