MediaWiki
REL1_24
|
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) | |
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. | |
setPageLinkRenderer (PageLinkRenderer $linkRenderer) | |
Initialize or override the PageLinkRenderer LinkSearchPage collaborates with. | |
setParams ($params) | |
Static Public Member Functions | |
static | mungeQuery ($query, $prot) |
Return an appropriately formatted LIKE query and the clause. | |
Protected Member Functions | |
getGroupName () | |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'. | |
Protected Attributes | |
PageLinkRenderer | $linkRenderer = null |
Private Member Functions | |
initServices () | |
Initialize any services we'll need (unless it has already been provided via a setter). |
Special:LinkSearch to search the external-links table.
Definition at line 29 of file SpecialLinkSearch.php.
LinkSearchPage::__construct | ( | $ | name = 'LinkSearch' | ) |
Definition at line 41 of file SpecialLinkSearch.php.
References $name.
LinkSearchPage::doQuery | ( | $ | offset = false , |
$ | limit = false |
||
) |
Override to check query validity.
mixed | $offset | Numerical offset or false for no offset |
mixed | $limit | Numerical limit or false for no limit |
Reimplemented from QueryPage.
Definition at line 274 of file SpecialLinkSearch.php.
LinkSearchPage::execute | ( | $ | par | ) |
This is the actual workhorse.
It does everything needed to make a real, honest-to-gosh query page.
string | $par |
Reimplemented from QueryPage.
Definition at line 79 of file SpecialLinkSearch.php.
References $out, $s, array(), as, Html\closeElement(), Html\element(), SpecialPage\getConfig(), SpecialPage\getLanguage(), SpecialPage\getOutput(), SpecialPage\getPageTitle(), SpecialPage\getRequest(), Html\hidden(), initServices(), Xml\inputLabel(), SpecialPage\msg(), Html\namespaceSelector(), Html\openElement(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), setParams(), Xml\submitButton(), text, wfParseUrl(), and wfScript().
LinkSearchPage::formatResult | ( | $ | skin, |
$ | result | ||
) |
Skin | $skin | |
object | $result | Result row |
Reimplemented from QueryPage.
Definition at line 258 of file SpecialLinkSearch.php.
LinkSearchPage::getGroupName | ( | ) | [protected] |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
Reimplemented from SpecialPage.
Definition at line 297 of file SpecialLinkSearch.php.
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 293 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 219 of file SpecialLinkSearch.php.
References $dbr, $retval, array(), SpecialPage\getConfig(), LinkFilter\keepOneWildcard(), list, mungeQuery(), and wfGetDB().
LinkSearchPage::initServices | ( | ) | [private] |
Initialize any services we'll need (unless it has already been provided via a setter).
This allows for dependency injection even though we don't control object creation.
Definition at line 67 of file SpecialLinkSearch.php.
Referenced by execute().
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 75 of file SpecialLinkSearch.php.
Disable RSS/Atom feeds.
Reimplemented from QueryPage.
Definition at line 174 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 209 of file SpecialLinkSearch.php.
References $params, array(), and SpecialPage\getConfig().
static LinkSearchPage::mungeQuery | ( | $ | query, |
$ | prot | ||
) | [static] |
Return an appropriately formatted LIKE query and the clause.
string | $query | Search pattern to search for |
string | $prot | Protocol, e.g. 'http://' |
Definition at line 186 of file SpecialLinkSearch.php.
Referenced by getQueryInfo().
LinkSearchPage::setPageLinkRenderer | ( | PageLinkRenderer $ | linkRenderer | ) |
Initialize or override the PageLinkRenderer LinkSearchPage collaborates with.
Useful mainly for testing.
PageLinkRenderer | $linkRenderer |
Definition at line 57 of file SpecialLinkSearch.php.
LinkSearchPage::setParams | ( | $ | params | ) |
PageLinkRenderer LinkSearchPage::$linkRenderer = null [protected] |
Definition at line 33 of file SpecialLinkSearch.php.