MediaWiki  REL1_22
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)
 getOrderFields ()
 The index is on (img_media_type, img_major_mime, img_minor_mime) which unfortunately doesn't have img_name at the end for sorting.
 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 don't 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

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

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.

References $name.


Member Function Documentation

This is the actual workhorse.

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

Returns:
int

Reimplemented from QueryPage.

Definition at line 102 of file SpecialMIMEsearch.php.

References $mime, array(), Xml\closeElement(), Xml\element(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitle(), global, Html\hidden(), Xml\inputLabel(), list, SpecialPage\msg(), Xml\openElement(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), File\splitMime(), Xml\submitButton(), and text.

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

Reimplemented from QueryPage.

Definition at line 140 of file SpecialMIMEsearch.php.

References $result, $time, $user, $wgContLang, SpecialPage\getLanguage(), global, Linker\link(), Linker\makeMediaLinkObj(), Title\makeTitle(), SpecialPage\msg(), and Title\newFromText().

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

The index is on (img_media_type, img_major_mime, img_minor_mime) which unfortunately doesn't have img_name at the end for sorting.

So tell db to sort it however it wishes (Its not super important that this report gives results in a logical order). As an aditional note, mysql seems to by default order things by img_name ASC, which is what we ideally want, so everything works out fine anyhow.

Reimplemented from QueryPage.

Definition at line 98 of file SpecialMIMEsearch.php.

References array().

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

References array().

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 45 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:
bool

Reimplemented from QueryPage.

Definition at line 37 of file SpecialMIMEsearch.php.

Sometime we don't want to build rss / atom feeds.

Returns:
bool

Reimplemented from QueryPage.

Definition at line 41 of file SpecialMIMEsearch.php.

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

Definition at line 171 of file SpecialMIMEsearch.php.

References array().

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

References array().


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: