本文整理汇总了PHP中MWExceptionHandler::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP MWExceptionHandler::getURL方法的具体用法?PHP MWExceptionHandler::getURL怎么用?PHP MWExceptionHandler::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MWExceptionHandler
的用法示例。
在下文中一共展示了MWExceptionHandler::getURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTML
/**
* If $wgShowExceptionDetails is true, return a HTML message with a
* backtrace to the error, otherwise show a message to ask to set it to true
* to show that information.
*
* @return string Html to output
*/
public function getHTML()
{
global $wgShowExceptionDetails;
if ($wgShowExceptionDetails) {
return '<p>' . nl2br(htmlspecialchars(MWExceptionHandler::getLogMessage($this))) . '</p><p>Backtrace:</p><p>' . nl2br(htmlspecialchars(MWExceptionHandler::getRedactedTraceAsString($this))) . "</p>\n";
} else {
$logId = MWExceptionHandler::getLogId($this);
$type = get_class($this);
return "<div class=\"errorbox\">" . '[' . $logId . '] ' . gmdate('Y-m-d H:i:s') . ": " . $this->msg("internalerror-fatal-exception", "Fatal exception of type \$1", $type, $logId, MWExceptionHandler::getURL($this)) . "</div>\n" . "<!-- Set \$wgShowExceptionDetails = true; " . "at the bottom of LocalSettings.php to show detailed " . "debugging information. -->";
}
}
示例2: getHTML
/**
* If $wgShowExceptionDetails is true, return a HTML message with a
* backtrace to the error, otherwise show a message to ask to set it to true
* to show that information.
*
* @param Exception|Throwable $e
* @return string Html to output
*/
public static function getHTML($e)
{
if (self::showBackTrace($e)) {
$html = "<div class=\"errorbox\"><p>" . nl2br(htmlspecialchars(MWExceptionHandler::getLogMessage($e))) . '</p><p>Backtrace:</p><p>' . nl2br(htmlspecialchars(MWExceptionHandler::getRedactedTraceAsString($e))) . "</p></div>\n";
} else {
$logId = WebRequest::getRequestId();
$html = "<div class=\"errorbox\">" . '[' . $logId . '] ' . gmdate('Y-m-d H:i:s') . ": " . self::msg("internalerror-fatal-exception", "Fatal exception of type \$1", get_class($e), $logId, MWExceptionHandler::getURL()) . "</div>\n" . "<!-- Set \$wgShowExceptionDetails = true; " . "at the bottom of LocalSettings.php to show detailed " . "debugging information. -->";
}
return $html;
}