MediaWiki
REL1_19
|
Special:LinkSearch to search the external-links table. More...
Public Member Functions | |
__construct ($name= 'LinkSearch') | |
doQuery ($offset=false, $limit=false) | |
Override to check query validity. | |
execute ($par) | |
This is the actual workhorse. | |
formatResult ($skin, $result) | |
Formats the results of the query for display. | |
getOrderFields () | |
Override to squash the ORDER BY. | |
getQueryInfo () | |
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s) for passing to Database::select() fields => Field(s) for passing to Database::select(), may be * conds => WHERE conditions options => options join_conds => JOIN conditions. | |
isCacheable () | |
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode and will not have their results written to the querycache table. | |
isSyndicated () | |
Disable RSS/Atom feeds. | |
linkParameters () | |
If using extra form wheely-dealies, return a set of parameters here as an associative array. | |
setParams ($params) | |
Static Public Member Functions | |
static | mungeQuery ($query, $prot) |
Return an appropriately formatted LIKE query and the clause. |
Special:LinkSearch to search the external-links table.
Definition at line 30 of file SpecialLinkSearch.php.
LinkSearchPage::__construct | ( | $ | name = 'LinkSearch' | ) |
Definition at line 37 of file SpecialLinkSearch.php.
LinkSearchPage::doQuery | ( | $ | offset = false , |
$ | limit = false |
||
) |
Override to check query validity.
Reimplemented from QueryPage.
Definition at line 189 of file SpecialLinkSearch.php.
References QueryPage\$limit, QueryPage\$offset, SpecialPage\getOutput(), and mungeQuery().
LinkSearchPage::execute | ( | $ | par | ) |
This is the actual workhorse.
It does everything needed to make a real, honest-to-gosh query page.
Reimplemented from QueryPage.
Definition at line 45 of file SpecialLinkSearch.php.
References $out, $wgMiserMode, $wgUrlProtocols, Xml\closeElement(), Xml\element(), SpecialPage\getLanguage(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitle(), Html\hidden(), Xml\inputLabel(), Xml\label(), Xml\namespaceSelector(), Xml\openElement(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), setParams(), Xml\submitButton(), and wfMsg().
LinkSearchPage::formatResult | ( | $ | skin, |
$ | result | ||
) |
Formats the results of the query for display.
The skin is the current skin; you can use it for making links. The result is a single row of result data. You should be able to grab SQL results off of it. If the function returns false, the line output will be skipped.
$skin | Skin |
$result | object Result row |
$skin | Skin object |
$result | Object: database row |
Reimplemented from QueryPage.
Definition at line 177 of file SpecialLinkSearch.php.
References $result, $title, $url, Linker\linkKnown(), Linker\makeExternalLink(), Title\makeTitle(), and wfMsgHtml().
Override to squash the ORDER BY.
We do a truncated index search, so the optimizer won't trust it as good enough for optimizing sort. The implicit ordering from the scan will usually do well enough for our needs.
Reimplemented from QueryPage.
Definition at line 207 of file SpecialLinkSearch.php.
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s) for passing to Database::select() fields => Field(s) for passing to Database::select(), may be * conds => WHERE conditions options => options join_conds => JOIN conditions.
Note that the query itself should return the following three columns: 'namespace', 'title', and 'value'. 'value' is used for sorting.
These may be stored in the querycache table for expensive queries, and that cached data will be returned sometimes, so the presence of extra fields can't be relied upon. The cached 'value' column will be an integer; non-numeric values are useful only for sorting the initial query (except if they're timestamps, see usesTimestamps()).
Don't include an ORDER or LIMIT clause, they will be added.
If this function is not overridden or returns something other than an array, getSQL() will be used instead. This is for backwards compatibility only and is strongly deprecated.
Reimplemented from QueryPage.
Definition at line 149 of file SpecialLinkSearch.php.
References $dbr, $wgMiserMode, LinkFilter\keepOneWildcard(), mungeQuery(), and wfGetDB().
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode and will not have their results written to the querycache table.
Reimplemented from QueryPage.
Definition at line 41 of file SpecialLinkSearch.php.
Disable RSS/Atom feeds.
Reimplemented from QueryPage.
Definition at line 116 of file SpecialLinkSearch.php.
If using extra form wheely-dealies, return a set of parameters here as an associative array.
They will be encoded and added to the paging links (prev/next/lengths).
Reimplemented from QueryPage.
Definition at line 139 of file SpecialLinkSearch.php.
References $wgMiserMode.
static LinkSearchPage::mungeQuery | ( | $ | query, |
$ | prot | ||
) | [static] |
Return an appropriately formatted LIKE query and the clause.
Definition at line 125 of file SpecialLinkSearch.php.
References $dbr, LinkFilter\makeLikeArray(), and wfGetDB().
Referenced by doQuery(), and getQueryInfo().
LinkSearchPage::setParams | ( | $ | params | ) |
Definition at line 31 of file SpecialLinkSearch.php.
Referenced by execute().