Go to the documentation of this file.
75 array(
'AncientPagesPage',
'Ancientpages' ),
76 array(
'BrokenRedirectsPage',
'BrokenRedirects' ),
77 array(
'DeadendPagesPage',
'Deadendpages' ),
78 array(
'DoubleRedirectsPage',
'DoubleRedirects' ),
79 array(
'FileDuplicateSearchPage',
'FileDuplicateSearch' ),
80 array(
'ListDuplicatedFilesPage',
'ListDuplicatedFiles'),
81 array(
'LinkSearchPage',
'LinkSearch' ),
82 array(
'ListredirectsPage',
'Listredirects' ),
83 array(
'LonelyPagesPage',
'Lonelypages' ),
84 array(
'LongPagesPage',
'Longpages' ),
85 array(
'MIMEsearchPage',
'MIMEsearch' ),
86 array(
'MostcategoriesPage',
'Mostcategories' ),
87 array(
'MostimagesPage',
'Mostimages' ),
88 array(
'MostinterwikisPage',
'Mostinterwikis' ),
89 array(
'MostlinkedCategoriesPage',
'Mostlinkedcategories' ),
90 array(
'MostlinkedtemplatesPage',
'Mostlinkedtemplates' ),
91 array(
'MostlinkedPage',
'Mostlinked' ),
92 array(
'MostrevisionsPage',
'Mostrevisions' ),
93 array(
'FewestrevisionsPage',
'Fewestrevisions' ),
94 array(
'ShortPagesPage',
'Shortpages' ),
95 array(
'UncategorizedCategoriesPage',
'Uncategorizedcategories' ),
96 array(
'UncategorizedPagesPage',
'Uncategorizedpages' ),
97 array(
'UncategorizedImagesPage',
'Uncategorizedimages' ),
98 array(
'UncategorizedTemplatesPage',
'Uncategorizedtemplates' ),
99 array(
'UnusedCategoriesPage',
'Unusedcategories' ),
100 array(
'UnusedimagesPage',
'Unusedimages' ),
101 array(
'WantedCategoriesPage',
'Wantedcategories' ),
102 array(
'WantedFilesPage',
'Wantedfiles' ),
103 array(
'WantedPagesPage',
'Wantedpages' ),
104 array(
'WantedTemplatesPage',
'Wantedtemplates' ),
105 array(
'UnwatchedPagesPage',
'Unwatchedpages' ),
106 array(
'UnusedtemplatesPage',
'Unusedtemplates' ),
107 array(
'WithoutInterwikiPage',
'Withoutinterwiki' ),
111 if ( !$wgDisableCounters ) {
112 $qp[] =
array(
'PopularPagesPage',
'Popularpages' );
125 $this->listoutput = $bool;
166 throw new MWException(
"Bug in a QueryPage: doesn't implement getQueryInfo() nor "
167 .
"getQuery() properly" );
178 return array(
'value' );
212 global $wgDisableQueryPages;
213 return $wgDisableQueryPages;
304 $fname = get_class( $this ) .
'::recache';
315 $num =
$res->numRows();
318 foreach (
$res as $row ) {
319 if ( isset( $row->value ) ) {
324 $value = intval( $row->value );
331 'qc_namespace' => $row->namespace,
332 'qc_title' => $row->title,
336 $dbw->begin( __METHOD__ );
337 # Clear out any old cached data
339 # Save results into the querycache table on the master
340 if ( count( $vals ) ) {
341 $dbw->insert(
'querycache', $vals, __METHOD__ );
343 # Update the querycache_info record for the page
345 $dbw->insert(
'querycache_info',
346 array(
'qci_type' => $this->
getName(),
'qci_timestamp' => $dbw->timestamp() ),
348 $dbw->commit( __METHOD__ );
351 if ( !$ignoreErrors ) {
375 $fname = get_class( $this ) .
"::reallyDoQuery";
381 foreach ( $order
as &$field ) {
386 if ( is_array(
$query ) ) {
393 if ( count( $order ) ) {
411 $sql .=
' ORDER BY ' . implode(
', ', $order );
450 $options[
'ORDER BY'] =
'qc_value DESC';
452 $options[
'ORDER BY'] =
'qc_value ASC';
455 'namespace' =>
'qc_namespace',
456 'title' =>
'qc_title',
457 'value' =>
'qc_value' ),
465 if ( is_null( $this->cachedTimestamp ) ) {
467 $fname = get_class( $this ) .
'::getCachedTimestamp';
468 $this->cachedTimestamp =
$dbr->selectField(
'querycache_info',
'qci_timestamp',
481 global $wgQueryCacheLimit, $wgDisableQueryPageUpdate;
495 $out->addWikiMsg(
'querypage-disabled' );
501 if ( $this->limit == 0 && $this->offset == 0 ) {
502 list( $this->limit, $this->offset ) = $this->
getRequest()->getLimitOffset();
507 # select one extra row for navigation
510 # Get the cached result, select one extra row for navigation
512 if ( !$this->listoutput ) {
514 # Fetch the timestamp of this update
517 $maxResults = $lang->formatNum( $wgQueryCacheLimit );
520 $updated = $lang->userTimeAndDate( $ts,
$user );
521 $updateddate = $lang->userDate( $ts,
$user );
522 $updatedtime = $lang->userTime( $ts,
$user );
523 $out->addMeta(
'Data-Cache-Time', $ts );
524 $out->addJsConfigVars(
'dataCacheTime', $ts );
525 $out->addWikiMsg(
'perfcachedts', $updated, $updateddate, $updatedtime, $maxResults );
527 $out->addWikiMsg(
'perfcached', $maxResults );
530 # If updates on this page have been disabled, let the user know
531 # that the data set won't be refreshed for now
532 if ( is_array( $wgDisableQueryPageUpdate )
533 && in_array( $this->
getName(), $wgDisableQueryPageUpdate )
536 "<div class=\"mw-querypage-no-updates\">\n$1\n</div>",
537 'querypage-no-updates'
543 $this->numRows =
$res->numRows();
550 # Top header and navigation
551 if ( $this->shownavigation ) {
553 if ( $this->numRows > 0 ) {
554 $out->addHTML( $this->
msg(
'showingresultsinrange' )->numParams(
555 min( $this->numRows, $this->limit ), #
do not show the one extra row,
if exist
556 $this->offset + 1, ( min( $this->numRows, $this->limit ) + $this->offset ) )->parseAsBlock() );
557 # Disable the "next" link when we reach the end
559 $this->limit, $this->
linkParameters(), ( $this->numRows <= $this->limit ) );
560 $out->addHTML(
'<p>' . $paging .
'</p>' );
562 # No results to show, so don't bother with "showing X of Y" etc.
563 # -- just let the user know and give up now
564 $out->addWikiMsg(
'specialpage-empty' );
570 # The actual results; specialist subclasses will want to handle this
571 # with more than a straight list, so we hand them the info, plus
572 # an OutputPage, and let them get on with it
577 min( $this->numRows, $this->limit ), #
do not
format the one extra row,
if exist
580 # Repeat the paging links at the bottom
581 if ( $this->shownavigation ) {
582 $out->addHTML(
'<p>' . $paging .
'</p>' );
587 return min( $this->numRows, $this->limit ); #
do not
return the one extra row,
if exist
606 if ( !$this->listoutput ) {
610 # $res might contain the whole 1,000 rows, so we read up to
611 # $num [should update this to use a Pager]
612 for ( $i = 0; $i < $num && $row =
$res->fetchObject(); $i++ ) {
615 $attr = ( isset( $row->usepatrol ) && $row->usepatrol && $row->patrolled == 0 )
616 ?
' class="not-patrolled"'
618 $html[] = $this->listoutput
620 :
"<li{$attr}>{$line}</li>\n";
624 # Flush the final result
629 $attr = ( isset( $row->usepatrol ) && $row->usepatrol && $row->patrolled == 0 )
630 ?
' class="not-patrolled"'
632 $html[] = $this->listoutput
634 :
"<li{$attr}>{$line}</li>\n";
638 if ( !$this->listoutput ) {
642 $html = $this->listoutput
644 : implode(
'',
$html );
655 return "\n<ol start='" . (
$offset + 1 ) .
"' class='special'>\n";
679 global $wgFeed, $wgFeedClasses, $wgFeedLimit;
682 $this->
getOutput()->addWikiMsg(
'feed-unavailable' );
686 $limit = min(
$limit, $wgFeedLimit );
688 if ( isset( $wgFeedClasses[$class] ) ) {
689 $feed =
new $wgFeedClasses[$class](
696 foreach (
$res as $obj ) {
699 $feed->outItem( $item );
717 if ( !isset( $row->title ) ) {
722 $date = isset( $row->timestamp ) ? $row->timestamp :
'';
725 $talkpage =
$title->getTalkPage();
726 $comments = $talkpage->getFullURL();
730 $title->getPrefixedText(),
742 return isset( $row->comment ) ? htmlspecialchars( $row->comment ) :
'';
746 return isset( $row->user_text ) ? $row->user_text :
'';
750 global $wgLanguageCode, $wgSitename;
752 return "$wgSitename - $desc [$wgLanguageCode]";
756 return $this->
msg(
'tagline' )->text();
783 if ( !
$res->numRows() ) {
788 foreach (
$res as $row ) {
789 $batch->add( $row->namespace, $row->title );
820 $pageLink =
$title->isKnown()
840 return $this->
msg(
'wantedpages-badtitle',
$result->title )->escaped();
853 $label = $this->
msg(
'nlinks' )->numParams(
$result->value )->escaped();
setListoutput( $bool)
A mutator for $this->listoutput;.
getPageTitle( $subpage=false)
Get a self-referential title object.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
bool $listoutput
Whether or not we want plain listoutput rather than an ordered list.
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
A base class for basic support for outputting syndication feeds in RSS and other formats.
forceExistenceCheck()
Should formatResult() always check page existence, even if the results are fresh? This is a (hopefull...
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
Class representing a list of titles The execute() method checks them all for existence and adds them ...
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
getOutput()
Get the OutputPage being used for this instance.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
isCacheable()
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode a...
getPageHeader()
The content returned by this function will be output before any result.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
linkParameters()
If using extra form wheely-dealies, return a set of parameters here as an associative array.
formatResult( $skin, $result)
Formats the results of the query for display.
outputResults( $out, $skin, $dbr, $res, $num, $offset)
Format and output report results using the given information plus OutputPage.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
preprocessResults( $db, $res)
Cache page existence for performance.
displayRestrictionError()
Output an error message telling the user what access level they have to have.
preprocessResults( $db, $res)
Do any necessary preprocessing of the result object.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
execute( $par)
This is the actual workhorse.
formatResult( $skin, $result)
Format an individual result.
getSkin()
Shortcut to get the skin being used for this instance.
isSyndicated()
Sometime we don't want to build rss / atom feeds.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
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 and the content language as $wgContLang
getLanguage()
Shortcut to get user's language.
getName()
Get the name of this Special Page.
reallyDoQuery( $limit, $offset=false)
Run the query and return the result.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
static openElement( $element, $attribs=null)
This opens an XML element.
int $offset
The offset and limit in use, as passed to the query() function.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be lis...
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
recache( $limit, $ignoreErrors=true)
Clear the cache and save new results.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
doFeed( $class='', $limit=50)
Similar to above, but packaging in a syndicated feed instead of a web page.
getRecacheDB()
Get a DB connection to be used for slow recache queries.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Database error base class.
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 & $options
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getOrderFields()
Subclasses return an array of fields to order by here.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
presenting them properly to the user as errors is done by the caller $title
userCanExecute(User $user)
Checks if the given user (identified by an object) can execute this special page (as defined by $mRes...
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
doQuery( $offset=false, $limit=false)
Somewhat deprecated, you probably want to be using execute()
makeWlhLink( $title, $result)
Make a "what links here" link for a given title.
fetchFromCache( $limit, $offset=false)
Fetch the query results from the query cache.
getRequest()
Get the WebRequest being used for this instance.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
feedResult( $row)
Override for custom handling.
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 $skin
isSyndicated()
Sometime we don't want to build rss / atom feeds.
getSQL()
For back-compat, subclasses may return a raw SQL query here, as a string.
Represents a title within MediaWiki.
static closeElement( $element)
Shortcut to close an XML element.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
tryLastResult()
Some special pages (for example SpecialListusers) might not return the current object formatted,...
$shownavigation
Wheter to show prev/next links.
if the prop value should be in the metadata multi language array format
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
usesTimestamps()
Does this query return timestamps rather than integers in its 'value' field? If true,...
sortDescending()
Override to sort by increasing values.
static getPages()
Get a list of query page classes and their associated special pages, for periodic updates.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
Result wrapper for grabbing data queried by someone else.
$numRows
The number of rows returned by the query.