MediaWiki  REL1_23
LinkSearchPage Class Reference

Special:LinkSearch to search the external-links table. More...

Inheritance diagram for LinkSearchPage:
Collaboration diagram for LinkSearchPage:

List of all members.

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

Detailed Description

Special:LinkSearch to search the external-links table.

Definition at line 29 of file SpecialLinkSearch.php.


Constructor & Destructor Documentation

LinkSearchPage::__construct ( name = 'LinkSearch')

Definition at line 41 of file SpecialLinkSearch.php.

References $name.


Member Function Documentation

LinkSearchPage::doQuery ( offset = false,
limit = false 
)

Override to check query validity.

Parameters:
mixed$offsetNumerical offset or false for no offset
mixed$limitNumerical limit or false for no limit

Reimplemented from QueryPage.

Definition at line 274 of file SpecialLinkSearch.php.

LinkSearchPage::formatResult ( skin,
result 
)
Parameters:
Skin$skin
object$resultResult row
Returns:
string

Reimplemented from QueryPage.

Definition at line 258 of file SpecialLinkSearch.php.

Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

Returns:
string
Since:
1.21

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.

Returns:
array

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.

Returns:
array
Since:
1.18

Reimplemented from QueryPage.

Definition at line 218 of file SpecialLinkSearch.php.

References $dbr, $retval, array(), global, LinkFilter\keepOneWildcard(), list, mungeQuery(), and wfGetDB().

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.

Returns:
bool
Since:
1.18

Reimplemented from QueryPage.

Definition at line 75 of file SpecialLinkSearch.php.

Disable RSS/Atom feeds.

Returns:
bool

Reimplemented from QueryPage.

Definition at line 172 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).

Returns:
array

Reimplemented from QueryPage.

Definition at line 207 of file SpecialLinkSearch.php.

References $params, array(), and global.

static LinkSearchPage::mungeQuery ( query,
prot 
) [static]

Return an appropriately formatted LIKE query and the clause.

Parameters:
String$querySearch pattern to search for
String$protProtocol, e.g. 'http://'
Returns:
array

Definition at line 184 of file SpecialLinkSearch.php.

Referenced by getQueryInfo().

Initialize or override the PageLinkRenderer LinkSearchPage collaborates with.

Useful mainly for testing.

Todo:
: query logic and rendering logic should be split and also injected
Parameters:
PageLinkRenderer$linkRenderer

Definition at line 57 of file SpecialLinkSearch.php.

Definition at line 35 of file SpecialLinkSearch.php.

References $params.

Referenced by execute().


Member Data Documentation

PageLinkRenderer LinkSearchPage::$linkRenderer = null [protected]

Definition at line 33 of file SpecialLinkSearch.php.


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