本文整理汇总了PHP中MWExceptionHandler::printError方法的典型用法代码示例。如果您正苦于以下问题:PHP MWExceptionHandler::printError方法的具体用法?PHP MWExceptionHandler::printError怎么用?PHP MWExceptionHandler::printError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MWExceptionHandler
的用法示例。
在下文中一共展示了MWExceptionHandler::printError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: report
/**
* Output a report about the exception and takes care of formatting.
* It will be either HTML or plain text based on isCommandLine().
*/
function report()
{
$log = $this->getLogMessage();
if ($log) {
wfDebugLog('exception', $log);
Wikia::log('exceptions-WIKIA', get_class($this), $log, true);
// Wikia change - @author macbre (BAC-1199)
}
if (self::isCommandLine()) {
MWExceptionHandler::printError($this->getText());
} else {
$this->reportHTML();
}
}
示例2: report
/**
* Output a report about the exception and takes care of formatting.
* It will be either HTML or plain text based on isCommandLine().
*/
function report()
{
global $wgMimeType;
MWExceptionHandler::logException($this);
if (defined('MW_API')) {
// Unhandled API exception, we can't be sure that format printer is alive
header('MediaWiki-API-Error: internal_api_error_' . get_class($this));
wfHttpError(500, 'Internal Server Error', $this->getText());
} elseif (self::isCommandLine()) {
MWExceptionHandler::printError($this->getText());
} else {
header('HTTP/1.1 500 MediaWiki exception');
header('Status: 500 MediaWiki exception', true);
header("Content-Type: {$wgMimeType}; charset=utf-8", true);
$this->reportHTML();
}
}
示例3: report
/**
* Output a report about the exception and takes care of formatting.
* It will be either HTML or plain text based on isCommandLine().
*/
function report()
{
$log = $this->getLogMessage();
if ($log) {
wfDebugLog('exception', $log);
}
if (self::isCommandLine()) {
MWExceptionHandler::printError($this->getText());
} else {
$this->reportHTML();
}
}
示例4: report
/**
* Output a report about the exception and takes care of formatting.
* It will be either HTML or plain text based on isCommandLine().
*/
function report()
{
global $wgLogExceptionBacktrace;
$log = $this->getLogMessage();
if ($log) {
if ($wgLogExceptionBacktrace) {
wfDebugLog('exception', $log . "\n" . $this->getTraceAsString() . "\n");
} else {
wfDebugLog('exception', $log);
}
}
if (defined('MW_API')) {
// Unhandled API exception, we can't be sure that format printer is alive
header('MediaWiki-API-Error: internal_api_error_' . get_class($this));
wfHttpError(500, 'Internal Server Error', $this->getText());
} elseif (self::isCommandLine()) {
MWExceptionHandler::printError($this->getText());
} else {
header("HTTP/1.1 500 MediaWiki exception");
header("Status: 500 MediaWiki exception", true);
$this->reportHTML();
}
}