本文整理匯總了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();
}
}