profiling correction
[mediawiki.git] / includes / SpecialShortpages.php
blob560b02b8c1af3f8c9935bf3068ea4a66c3df43c8
1 <?php
3 require_once("QueryPage.php");
5 class ShortPagesPage extends QueryPage {
7 function getName() {
8 return "Shortpages";
11 function isExpensive() {
12 return true;
15 function getSQL() {
16 return
17 "SELECT 'Shortpages' as type,
18 cur_namespace as namespace,
19 cur_title as title,
20 LENGTH(cur_text) AS value
21 FROM cur
22 WHERE cur_namespace=0 AND cur_is_redirect=0";
25 function sortDescending() {
26 return false;
29 function formatResult( $skin, $result ) {
30 global $wgLang;
31 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
32 $link = $skin->makeKnownLink( $result->title, "" );
33 return "{$link} ({$nb})";
37 function wfSpecialShortpages()
39 list( $limit, $offset ) = wfCheckLimits();
41 $spp = new ShortPagesPage();
43 return $spp->doQuery( $offset, $limit );