summaryrefslogtreecommitdiff
path: root/includes/Exception.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-05-16 20:58:53 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-05-16 20:58:53 +0000
commitcecb985bee3bdd252e1b8dc0bd500b37cd52be01 (patch)
tree17266aa237742640aabee7856f0202317a45d540 /includes/Exception.php
parent0bac06c301f2a83edb0236e4c2434da16848d549 (diff)
Aktualisierung auf MediaWiki 1.10.0
Plugins angepasst und verbessert kleine Korrekturen am Design
Diffstat (limited to 'includes/Exception.php')
-rw-r--r--includes/Exception.php30
1 files changed, 25 insertions, 5 deletions
diff --git a/includes/Exception.php b/includes/Exception.php
index ad7ec14a..4cf0b7ba 100644
--- a/includes/Exception.php
+++ b/includes/Exception.php
@@ -1,5 +1,9 @@
<?php
+/**
+ * MediaWiki exception
+ * @addtogroup Exception
+ */
class MWException extends Exception
{
function useOutputPage() {
@@ -12,6 +16,7 @@ class MWException extends Exception
return is_object( $wgLang );
}
+ /** Get a message from i18n */
function msg( $key, $fallback /*[, params...] */ ) {
$args = array_slice( func_get_args(), 2 );
if ( $this->useMessageCache() ) {
@@ -21,6 +26,7 @@ class MWException extends Exception
}
}
+ /* If wgShowExceptionDetails, return a HTML message with a backtrace to the error. */
function getHTML() {
global $wgShowExceptionDetails;
if( $wgShowExceptionDetails ) {
@@ -33,6 +39,7 @@ class MWException extends Exception
}
}
+ /* If wgShowExceptionDetails, return a text message with a backtrace to the error */
function getText() {
global $wgShowExceptionDetails;
if( $wgShowExceptionDetails ) {
@@ -43,7 +50,8 @@ class MWException extends Exception
"in LocalSettings.php to show detailed debugging information.</p>";
}
}
-
+
+ /* Return titles of this error page */
function getPageTitle() {
if ( $this->useMessageCache() ) {
return wfMsg( 'internalerror' );
@@ -52,7 +60,10 @@ class MWException extends Exception
return "$wgSitename error";
}
}
-
+
+ /** Return the requested URL and point to file and line number from which the
+ * exception occured
+ */
function getLogMessage() {
global $wgRequest;
$file = $this->getFile();
@@ -60,7 +71,8 @@ class MWException extends Exception
$message = $this->getMessage();
return $wgRequest->getRequestURL() . " Exception from line $line of $file: $message";
}
-
+
+ /** Output the exception report using HTML */
function reportHTML() {
global $wgOut;
if ( $this->useOutputPage() ) {
@@ -78,11 +90,15 @@ class MWException extends Exception
echo $this->htmlFooter();
}
}
-
+
+ /** Print the exception report using text */
function reportText() {
echo $this->getText();
}
+ /* Output a report about the exception and takes care of formatting.
+ * It will be either HTML or plain text based on $wgCommandLineMode.
+ */
function report() {
global $wgCommandLineMode;
if ( $wgCommandLineMode ) {
@@ -125,6 +141,7 @@ class MWException extends Exception
/**
* Exception class which takes an HTML error message, and does not
* produce a backtrace. Replacement for OutputPage::fatalError().
+ * @addtogroup Exception
*/
class FatalError extends MWException {
function getHTML() {
@@ -136,6 +153,9 @@ class FatalError extends MWException {
}
}
+/**
+ * @addtogroup Exception
+ */
class ErrorPageError extends MWException {
public $title, $msg;
@@ -203,7 +223,7 @@ function wfReportException( Exception $e ) {
function wfExceptionHandler( $e ) {
global $wgFullyInitialised;
wfReportException( $e );
-
+
// Final cleanup, similar to wfErrorExit()
if ( $wgFullyInitialised ) {
try {