Go to the documentation of this file.
39 parent::__construct(
$error );
55 global $wgShowDBErrorBacktrace;
59 if ( $wgShowDBErrorBacktrace ) {
60 $s .=
"Backtrace:\n" . $this->getTraceAsString() .
"\n";
70 global $wgShowDBErrorBacktrace;
74 if ( $wgShowDBErrorBacktrace ) {
75 $s .=
'<p>Backtrace:</p><pre>' . htmlspecialchars( $this->getTraceAsString() ) .
'</pre>';
85 return $this->getMessage();
92 return '<p>' . nl2br( htmlspecialchars( $this->
getTextContent() ) ) .
'</p>';
108 $msg =
'DB connection error';
110 if ( trim(
$error ) !=
'' ) {
113 $error = $this->db->getServer();
116 parent::__construct(
$db, $msg );
138 $args = array_slice( func_get_args(), 2 );
141 $message =
$wgLang->getMessage( $key );
161 global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors;
163 $sorry = htmlspecialchars( $this->
msg(
165 'Sorry! This site is experiencing technical difficulties.'
167 $again = htmlspecialchars( $this->
msg(
169 'Try waiting a few minutes and reloading.'
172 if ( $wgShowHostnames || $wgShowSQLErrors ) {
175 htmlspecialchars( $this->
msg(
'dberr-info',
'(Cannot contact the database server: $1)' ) )
178 $info = htmlspecialchars( $this->
msg(
180 '(Cannot contact the database server)'
187 $html =
"<h1>$sorry</h1><p>$again</p><p><small>$info</small></p>";
189 if ( $wgShowDBErrorBacktrace ) {
190 $html .=
'<p>Backtrace:</p><pre>' . htmlspecialchars( $this->getTraceAsString() ) .
'</pre>';
200 global $wgShowHostnames, $wgShowSQLErrors;
202 if ( $wgShowHostnames || $wgShowSQLErrors ) {
203 return $this->getMessage();
205 return 'DB connection error';
218 if ( $wgUseFileCache ) {
226 $cache .=
'<div style="border:1px solid #ffd0d0;padding:1em;">' .
227 htmlspecialchars( $this->
msg(
'dberr-cachederror',
228 'This is a cached copy of the requested page, and may not be up to date.' ) ) .
232 echo
"{$cache}<hr />{$this->getHTML()}</body></html>";
242 parent::reportHTML();
249 global $wgSitename, $wgCanonicalServer, $wgRequest;
251 $usegoogle = htmlspecialchars( $this->
msg(
253 'You can try searching via Google in the meantime.'
255 $outofdate = htmlspecialchars( $this->
msg(
257 'Note that their indexes of our content may be out of date.'
259 $googlesearch = htmlspecialchars( $this->
msg(
'searchbutton',
'Search' ) );
261 $search = htmlspecialchars( $wgRequest->getVal(
'search' ) );
263 $server = htmlspecialchars( $wgCanonicalServer );
264 $sitename = htmlspecialchars( $wgSitename );
267 <div style=
"margin: 1.5em">$usegoogle<br />
268 <small>$outofdate</small>
270 <
form method=
"get" action=
"//www.google.com/search" id=
"googlesearch">
271 <input
type=
"hidden" name=
"domains" value=
"$server" />
272 <input
type=
"hidden" name=
"num" value=
"50" />
273 <input
type=
"hidden" name=
"ie" value=
"UTF-8" />
274 <input
type=
"hidden" name=
"oe" value=
"UTF-8" />
276 <input
type=
"text" name=
"q" size=
"31" maxlength=
"255" value=
"$search" />
277 <input
type=
"submit" name=
"btnG" value=
"$googlesearch" />
279 <label><input
type=
"radio" name=
"sitesearch" value=
"$server" checked=
"checked" />$sitename</label>
280 <label><input
type=
"radio" name=
"sitesearch" value=
"" />WWW</label>
294 if ( $context->getOutput()->isDisabled() ) {
299 if ( $context->getTitle() ) {
301 $t = $context->getTitle()->getPrefixedDBkey();
306 $t = str_replace(
' ',
'_', $context->getRequest()->getVal(
'title' ) );
309 $this->
msg(
'mainpage',
'Main Page' ) )->getPrefixedDBkey();
314 if (
$cache->isCached() ) {
315 return $cache->fetchText();
336 $message =
"A database error has occurred. Did you forget to run " .
337 "maintenance/update.php after upgrading? See: " .
338 "https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
340 "Function: $fname\n" .
341 "Error: $errno $error\n";
342 parent::__construct(
$db, $message );
362 return $this->
msg(
'databaseerror',
'Database error' );
369 $key =
'databaseerror-text';
375 foreach ( $details
as $key => $detail ) {
377 '$1', call_user_func_array(
'Html::element', $detail ),
393 $key =
'databaseerror-textcl';
417 global $wgShowHostnames, $wgShowSQLErrors;
422 if ( $wgShowSQLErrors ) {
423 $details[
'databaseerror-query'] =
array(
427 if ( $wgShowHostnames || $wgShowSQLErrors ) {
429 $details[
'databaseerror-function'] =
array(
'code',
$attribs, $this->fname );
430 $details[
'databaseerror-error'] =
array(
'samp',
$attribs, $errorMessage );
442 'databaseerror-text' =>
'A database query error has occurred.
443 This may indicate a bug in the software.',
444 'databaseerror-textcl' =>
'A database query error has occurred.',
445 'databaseerror-query' =>
'Query: $1',
446 'databaseerror-function' =>
'Function: $1',
447 'databaseerror-error' =>
'Error: $1',
__construct(DatabaseBase $db=null, $error='unknown error')
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
string $error
Error text *.
wfMsgReplaceArgs( $message, $args)
Replace message parameter keys on the given formatted output.
Base class for the more common types of database errors.
getTechnicalDetails()
Make a list of technical details that can be shown to the user.
useMessageCache()
Can the extension use the Message class/wfMessage to get i18n-ed messages?
__construct(DatabaseBase $db=null, $error)
Construct a database error.
SQLite shares the MySQL schema file at maintenance tables sql
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
null means default in associative array form
static singleton()
Get the signleton instance of this class.
Database error base class.
__construct(DatabaseBase $db, $error, $errno, $sql, $fname)
Database abstraction object.
msg( $key, $fallback)
Get a message from i18n.
static newFromTitle( $title, $action)
Construct an ObjectFileCache from a Title and an action.
getFallbackMessage( $key)
static getMain()
Static methods.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
reportHTML()
Output the exception report using HTML.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs