MediaWiki  1.23.1
DBQueryError Class Reference
Inheritance diagram for DBQueryError:
Collaboration diagram for DBQueryError:

Public Member Functions

 __construct (DatabaseBase $db, $error, $errno, $sql, $fname)
 
 getPageTitle ()
 
 isLoggable ()
 
- Public Member Functions inherited from DBExpectedError
 getHTML ()
 
 getText ()
 
- Public Member Functions inherited from DBError
 __construct (DatabaseBase $db=null, $error)
 Construct a database error. More...
 
- Public Member Functions inherited from MWException
 getLogId ()
 Get a the ID for this error. More...
 
 getLogMessage ()
 Return the requested URL and point to file and line number from which the exception occurred. More...
 
 msg ( $key, $fallback)
 Get a message from i18n. More...
 
 report ()
 Output a report about the exception and takes care of formatting. More...
 
 reportHTML ()
 Output the exception report using HTML. More...
 
 runHooks ( $name, $args=array())
 Run hook to allow extensions to modify the text of the exception. More...
 
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages? More...
 
 useOutputPage ()
 Should the exception use $wgOut to output the error? More...
 

Public Attributes

 $errno
 
 $error
 
 $fname
 
 $sql
 
- Public Attributes inherited from DBError
DatabaseBase $db
 

Protected Member Functions

 getHTMLContent ()
 
 getTechnicalDetails ()
 Make a list of technical details that can be shown to the user. More...
 
 getTextContent ()
 

Private Member Functions

 getFallbackMessage ( $key)
 

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. More...
 

Detailed Description

Definition at line 306 of file DatabaseError.php.

Constructor & Destructor Documentation

◆ __construct()

DBQueryError::__construct ( DatabaseBase  $db,
  $error,
  $errno,
  $sql,
  $fname 
)
Parameters
DatabaseBase$db
string$error
int | string$errno
string$sql
string$fname

Definition at line 316 of file DatabaseError.php.

Member Function Documentation

◆ getFallbackMessage()

DBQueryError::getFallbackMessage (   $key)
private
Parameters
string$keyMessage key
Returns
string English message text

Definition at line 421 of file DatabaseError.php.

Referenced by getTextContent().

◆ getHTMLContent()

DBQueryError::getHTMLContent ( )
protected
Returns
string

Reimplemented from DBExpectedError.

Definition at line 349 of file DatabaseError.php.

◆ getPageTitle()

DBQueryError::getPageTitle ( )
Returns
string

Reimplemented from MWException.

Definition at line 342 of file DatabaseError.php.

◆ getTechnicalDetails()

DBQueryError::getTechnicalDetails ( )
protected

Make a list of technical details that can be shown to the user.

This information can aid in debugging yet may be useful to an attacker trying to exploit a security weakness in the software or server configuration.

Thus no such details are shown by default, though if $wgShowHostnames is true, only the full SQL query is hidden; in fact, the error message often does contain a hostname, and sites using this option probably don't care much about "security by obscurity". Of course, if $wgShowSQLErrors is true, the SQL query is shown.

Returns
array Keys are message keys; values are arrays of arguments for Html::element(). Array will be empty if users are not allowed to see any of these details at all.

Definition at line 397 of file DatabaseError.php.

◆ getTextContent()

DBQueryError::getTextContent ( )
protected
Returns
string

Reimplemented from DBExpectedError.

Definition at line 373 of file DatabaseError.php.

References $s, array(), Html\element(), getFallbackMessage(), and MWException\msg().

◆ isLoggable()

DBQueryError::isLoggable ( )
Returns
bool

Reimplemented from MWException.

Definition at line 334 of file DatabaseError.php.

Member Data Documentation

◆ $errno

DBQueryError::$errno

Definition at line 307 of file DatabaseError.php.

◆ $error

DBQueryError::$error

Definition at line 307 of file DatabaseError.php.

◆ $fname

DBQueryError::$fname

Definition at line 307 of file DatabaseError.php.

◆ $sql

DBQueryError::$sql

Definition at line 307 of file DatabaseError.php.


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