MediaWiki  REL1_19
MIMEsearchPage Class Reference

Searches the database for files of the requested MIME type, comparing this with the 'img_major_mime' and 'img_minor_mime' fields in the image table. More...

Inheritance diagram for MIMEsearchPage:
Collaboration diagram for MIMEsearchPage:

List of all members.

Public Member Functions

 __construct ($name= 'MIMEsearch')
 execute ($par)
 This is the actual workhorse.
 formatResult ($skin, $result)
 Formats the results of the query for display.
 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.
 isExpensive ()
 Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
 isSyndicated ()
 Sometime we dont want to build rss / atom feeds.
 linkParameters ()
 If using extra form wheely-dealies, return a set of parameters here as an associative array.

Public Attributes

 $minor

Static Protected Member Functions

static isValidType ($type)

Protected Attributes

 $major

Detailed Description

Searches the database for files of the requested MIME type, comparing this with the 'img_major_mime' and 'img_minor_mime' fields in the image table.

Definition at line 30 of file SpecialMIMEsearch.php.


Constructor & Destructor Documentation

MIMEsearchPage::__construct ( name = 'MIMEsearch')

Definition at line 33 of file SpecialMIMEsearch.php.


Member Function Documentation

This is the actual workhorse.

It does everything needed to make a real, honest-to-gosh query page.

Reimplemented from QueryPage.

Definition at line 61 of file SpecialMIMEsearch.php.

References $mime, Xml\closeElement(), Xml\element(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitleFor(), Html\hidden(), Xml\inputLabel(), Xml\openElement(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), File\splitMime(), Xml\submitButton(), and wfMsg().

Here is the call graph for this function:

MIMEsearchPage::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.

Parameters:
$skinSkin
$resultobject Result row
Returns:
mixed String or false to skip
Parameters:
$skinSkin object
$resultObject: database row

Reimplemented from QueryPage.

Definition at line 86 of file SpecialMIMEsearch.php.

References $result, $user, $wgContLang, SpecialPage\getLanguage(), Linker\link(), Linker\makeMediaLinkObj(), Title\makeTitle(), Title\newFromText(), wfMsg(), and wfMsgHtml().

Here is the call graph for this function:

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 45 of file SpecialMIMEsearch.php.

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:
Boolean
Since:
1.18

Reimplemented from QueryPage.

Definition at line 39 of file SpecialMIMEsearch.php.

Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.

$wgDisableQueryPages causes all query pages to be declared expensive. Some query pages are always expensive.

Returns:
Boolean

Reimplemented from QueryPage.

Definition at line 37 of file SpecialMIMEsearch.php.

Sometime we dont want to build rss / atom feeds.

Returns:
Boolean

Reimplemented from QueryPage.

Definition at line 38 of file SpecialMIMEsearch.php.

static MIMEsearchPage::isValidType ( type) [static, protected]
Parameters:
$typestring
Returns:
bool

Definition at line 113 of file SpecialMIMEsearch.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 41 of file SpecialMIMEsearch.php.


Member Data Documentation

MIMEsearchPage::$major [protected]

Definition at line 31 of file SpecialMIMEsearch.php.

MIMEsearchPage::$minor

Definition at line 31 of file SpecialMIMEsearch.php.


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