MediaWiki REL1_27
DBConnectionError Class Reference
Inheritance diagram for DBConnectionError:
Collaboration diagram for DBConnectionError:

Public Member Functions

 __construct (DatabaseBase $db=null, $error='unknown error')
 
 getHTML ()
 
 isLoggable ()
 
 msg ( $key, $fallback)
 
 reportHTML ()
 Output the exception report using HTML.
 
 useOutputPage ()
 
- Public Member Functions inherited from DBExpectedError
 getPageTitle ()
 Return the title of the page when reporting this error in a HTTP response.
 
 getText ()
 
- Public Member Functions inherited from MWException
 report ()
 Output a report about the exception and takes care of formatting.
 
 runHooks ( $name, $args=[])
 Run hook to allow extensions to modify the text of the exception.
 
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages?
 

Public Attributes

string $error
 Error text.
 
- Public Attributes inherited from DBError
DatabaseBase $db
 

Protected Member Functions

 getTextContent ()
 
- Protected Member Functions inherited from DBExpectedError
 getHTMLContent ()
 

Private Member Functions

 fileCachedPage ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MWException
static isCommandLine ()
 Check whether we are in command line mode or not to report the exception in the correct format.
 

Detailed Description

Definition at line 103 of file DatabaseError.php.

Constructor & Destructor Documentation

◆ __construct()

DBConnectionError::__construct ( DatabaseBase  $db = null,
  $error = 'unknown error' 
)
Parameters
DatabaseBase$dbObject throwing the error
string$errorError text

Reimplemented from DBError.

Definition at line 111 of file DatabaseError.php.

References DBError\$db, and $error.

Member Function Documentation

◆ fileCachedPage()

DBConnectionError::fileCachedPage ( )
private
Returns
string

Definition at line 247 of file DatabaseError.php.

References $cache, $context, $t, RequestContext\getMain(), msg(), and Title\newFromText().

Referenced by reportHTML().

◆ getHTML()

DBConnectionError::getHTML ( )
Returns
string Safe HTML

Reimplemented from DBExpectedError.

Definition at line 160 of file DatabaseError.php.

References $html, $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors, Html\element(), global, msg(), and MessageCache\singleton().

◆ getTextContent()

DBConnectionError::getTextContent ( )
protected
Returns
string

Reimplemented from DBExpectedError.

Definition at line 198 of file DatabaseError.php.

References $wgShowHostnames, $wgShowSQLErrors, and global.

◆ isLoggable()

DBConnectionError::isLoggable ( )
Returns
bool

Reimplemented from MWException.

Definition at line 152 of file DatabaseError.php.

◆ msg()

DBConnectionError::msg (   $key,
  $fallback 
)
Parameters
string$key
string$fallbackUnescaped alternative error text in case the message cache cannot be used. Can contain parameters as in regular messages, that should be passed as additional parameters.
Returns
string Unprocessed plain error text with parameters replaced

Reimplemented from MWException.

Definition at line 139 of file DatabaseError.php.

References $args, $fallback, MWException\useMessageCache(), wfMessage(), and wfMsgReplaceArgs().

Referenced by fileCachedPage(), getHTML(), and reportHTML().

◆ reportHTML()

DBConnectionError::reportHTML ( )

Output the exception report using HTML.

Returns
void

Reimplemented from MWException.

Definition at line 213 of file DatabaseError.php.

References $cache, $e, $wgUseFileCache, fileCachedPage(), global, and msg().

◆ useOutputPage()

DBConnectionError::useOutputPage ( )
Returns
bool

Reimplemented from MWException.

Definition at line 127 of file DatabaseError.php.

Member Data Documentation

◆ $error

string DBConnectionError::$error

Error text.

Definition at line 105 of file DatabaseError.php.

Referenced by __construct().


The documentation for this class was generated from the following file: