MediaWiki
REL1_24
|
Public Member Functions | |
__construct ($name= 'MediaStatistics') | |
formatResult ($skin, $result) | |
This method isn't used, since we override outputResults, but we need to implement since abstract in parent class. | |
getOrderFields () | |
How to sort the results. | |
getQueryInfo () | |
Query to do. | |
isExpensive () | |
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode. | |
preprocessResults ($dbr, $res) | |
Initialize total values so we can figure out percentages later. | |
Public Attributes | |
$totalBytes = 0 | |
Protected Member Functions | |
getGroupName () | |
What group to put the page in. | |
getTableHeaderRow () | |
Get (not output) the header row for the table. | |
makePercentPretty ($decimal) | |
outputMediaType ($mediaType) | |
Output a header for a new media type section. | |
outputResults ($out, $skin, $dbr, $res, $num, $offset) | |
Output the results of the query. | |
outputTableEnd () | |
Output closing | |
outputTableRow ($mime, $count, $bytes) | |
Output a row of the stats table. | |
outputTableStart ($mediaType) | |
Output the start of the table. | |
Protected Attributes | |
$totalCount = 0 | |
Private Member Functions | |
getExtensionList ($mime) | |
Given a mime type, return a comma separated list of allowed extensions. | |
splitFakeTitle ($fakeTitle) | |
parse the fake title format that this special page abuses querycache with. |
Definition at line 28 of file SpecialMediaStatistics.php.
MediaStatisticsPage::__construct | ( | $ | name = 'MediaStatistics' | ) |
Definition at line 31 of file SpecialMediaStatistics.php.
References $name.
MediaStatisticsPage::formatResult | ( | $ | skin, |
$ | result | ||
) |
This method isn't used, since we override outputResults, but we need to implement since abstract in parent class.
$skin | Skin |
$result | stdObject Result row |
Reimplemented from QueryPage.
Definition at line 306 of file SpecialMediaStatistics.php.
MediaStatisticsPage::getExtensionList | ( | $ | mime | ) | [private] |
Given a mime type, return a comma separated list of allowed extensions.
$mime | String mime type |
Definition at line 199 of file SpecialMediaStatistics.php.
References $ext, $mime, as, SpecialPage\getLanguage(), and MimeMagic\singleton().
Referenced by outputTableRow().
MediaStatisticsPage::getGroupName | ( | ) | [protected] |
What group to put the page in.
Reimplemented from SpecialPage.
Definition at line 295 of file SpecialMediaStatistics.php.
How to sort the results.
It's important that img_media_type come first, otherwise the tables will be fragmented.
Reimplemented from QueryPage.
Definition at line 93 of file SpecialMediaStatistics.php.
References array().
Query to do.
This abuses the query cache table by storing mime types as "titles".
This will store entries like [[Media:BITMAP;image/jpeg;200;20000]] where the form is Media type;mime type;count;bytes.
This relies on the behaviour that when value is tied, the order things come out of querycache table is the order they went in. Which is hacky. However, other special pages like Special:Deadendpages and Special:BrokenRedirects also rely on this.
Reimplemented from QueryPage.
Definition at line 56 of file SpecialMediaStatistics.php.
MediaStatisticsPage::getTableHeaderRow | ( | ) | [protected] |
Get (not output) the header row for the table.
Definition at line 238 of file SpecialMediaStatistics.php.
References array(), as, SpecialPage\msg(), and Html\rawElement().
Referenced by outputTableStart().
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.
Reimplemented from QueryPage.
Definition at line 39 of file SpecialMediaStatistics.php.
MediaStatisticsPage::makePercentPretty | ( | $ | decimal | ) | [protected] |
float | $decimal | A decimal percentage (ie for 12.3%, this would be 0.123) |
Definition at line 182 of file SpecialMediaStatistics.php.
Referenced by outputTableRow().
MediaStatisticsPage::outputMediaType | ( | $ | mediaType | ) | [protected] |
Output a header for a new media type section.
$mediaType | string A media type (e.g. from the MEDIATYPE_xxx constants) |
Definition at line 259 of file SpecialMediaStatistics.php.
References array(), Html\element(), SpecialPage\getOutput(), SpecialPage\msg(), and text.
Referenced by outputResults().
MediaStatisticsPage::outputResults | ( | $ | out, |
$ | skin, | ||
$ | dbr, | ||
$ | res, | ||
$ | num, | ||
$ | offset | ||
) | [protected] |
Output the results of the query.
$out | OutputPage |
$skin | Skin (deprecated presumably) |
$dbr | DatabaseBase |
$res | ResultWrapper Results from query |
$num | integer Number of results |
$offset | integer Paging offset (Should always be 0 in our case) |
Reimplemented from QueryPage.
Definition at line 107 of file SpecialMediaStatistics.php.
References $mime, $res, $totalBytes, $totalCount, as, list, outputMediaType(), outputTableEnd(), outputTableRow(), outputTableStart(), and splitFakeTitle().
MediaStatisticsPage::outputTableEnd | ( | ) | [protected] |
Output closing
Definition at line 131 of file SpecialMediaStatistics.php.
References Html\closeElement(), and SpecialPage\getOutput().
Referenced by outputResults().
MediaStatisticsPage::outputTableRow | ( | $ | mime, |
$ | count, | ||
$ | bytes | ||
) | [protected] |
Output a row of the stats table.
$mime | String mime type (e.g. image/jpeg) |
$count | integer Number of images of this type |
$totalBytes | integer Total space for images of this type |
Definition at line 142 of file SpecialMediaStatistics.php.
References $count, $mime, array(), Html\element(), getExtensionList(), SpecialPage\getOutput(), SpecialPage\getTitleFor(), Linker\link(), makePercentPretty(), SpecialPage\msg(), and Html\rawElement().
Referenced by outputResults().
MediaStatisticsPage::outputTableStart | ( | $ | mediaType | ) | [protected] |
Output the start of the table.
Including opening
and first
with column headers.
Definition at line 218 of file SpecialMediaStatistics.php.
References array(), SpecialPage\getOutput(), getTableHeaderRow(), and Html\openElement().
Referenced by outputResults().
MediaStatisticsPage::preprocessResults | ( | $ | dbr, |
$ | res | ||
) |
Initialize total values so we can figure out percentages later.
$dbr | DatabaseBase |
$res | ResultWrapper |
Reimplemented from QueryPage.
Definition at line 316 of file SpecialMediaStatistics.php.
References $count, $res, as, list, and splitFakeTitle().
MediaStatisticsPage::splitFakeTitle | ( | $ | fakeTitle | ) | [private] |
parse the fake title format that this special page abuses querycache with.
$fakeTitle | String A string formatted as <media type>="">;<mime type>="">;<count>;<bytes> |
Definition at line 287 of file SpecialMediaStatistics.php.
Referenced by outputResults(), and preprocessResults().
MediaStatisticsPage::$totalBytes = 0 |
Definition at line 29 of file SpecialMediaStatistics.php.
Referenced by outputResults().
MediaStatisticsPage::$totalCount = 0 [protected] |
Definition at line 29 of file SpecialMediaStatistics.php.
Referenced by outputResults().