MediaWiki  REL1_19
FileDuplicateSearchPage Class Reference

Searches the database for files of the requested hash, comparing this with the 'img_sha1' field in the image table. More...

Inheritance diagram for FileDuplicateSearchPage:
Collaboration diagram for FileDuplicateSearchPage:

List of all members.

Public Member Functions

 __construct ($name= 'FileDuplicateSearch')
 execute ($par)
 This is the actual workhorse.
 formatResult ($skin, $result)
 getDupes ()
 Fetch dupes from all connected file repositories.
 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.
 isCached ()
 Whether or not the output of the page in question is retrieved from the database cache.
 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.
 showList ($dupes)

Public Attributes

 $filename = ''

Protected Attributes

 $file = null
 $hash = ''

Detailed Description

Searches the database for files of the requested hash, comparing this with the 'img_sha1' field in the image table.

Definition at line 31 of file SpecialFileDuplicateSearch.php.


Constructor & Destructor Documentation

FileDuplicateSearchPage::__construct ( name = 'FileDuplicateSearch')

Definition at line 39 of file SpecialFileDuplicateSearch.php.


Member Function Documentation

FileDuplicateSearchPage::formatResult ( skin,
result 
)
Parameters:
Skin$skin
File$result
Returns:
string

Reimplemented from QueryPage.

Definition at line 170 of file SpecialFileDuplicateSearch.php.

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

Referenced by showList().

Here is the call graph for this function:

Here is the caller graph for this function:

Fetch dupes from all connected file repositories.

Returns:
Array of File objects

Definition at line 56 of file SpecialFileDuplicateSearch.php.

References RepoGroup\singleton().

Referenced by execute().

Here is the call graph for this function:

Here is the caller 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 77 of file SpecialFileDuplicateSearch.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 44 of file SpecialFileDuplicateSearch.php.

Whether or not the output of the page in question is retrieved from the database cache.

Returns:
Boolean

Reimplemented from QueryPage.

Definition at line 45 of file SpecialFileDuplicateSearch.php.

Sometime we dont want to build rss / atom feeds.

Returns:
Boolean

Reimplemented from QueryPage.

Definition at line 43 of file SpecialFileDuplicateSearch.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 47 of file SpecialFileDuplicateSearch.php.

Parameters:
$dupesArray of File objects

Definition at line 64 of file SpecialFileDuplicateSearch.php.

References QueryPage\closeList(), formatResult(), SpecialPage\getOutput(), and QueryPage\openList().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

FileDuplicateSearchPage::$file = null [protected]

Definition at line 37 of file SpecialFileDuplicateSearch.php.

FileDuplicateSearchPage::$filename = ''

Definition at line 32 of file SpecialFileDuplicateSearch.php.

FileDuplicateSearchPage::$hash = '' [protected]

Definition at line 32 of file SpecialFileDuplicateSearch.php.


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