Record and report memory usage change in profiling.
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
index 560b02b..4feb514 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+#
+# SpecialShortpages extends QueryPage. It is used to return the shortest
+# pages in the database.
+#
 
 require_once("QueryPage.php");
 
@@ -13,12 +17,15 @@ class ShortPagesPage extends QueryPage {
        }
 
        function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               $cur = $dbr->tableName( 'cur' );
+               
                return
                        "SELECT 'Shortpages' as type,
                                        cur_namespace as namespace,
                                cur_title as title,
                                LENGTH(cur_text) AS value
-                       FROM cur
+                       FROM $cur
                        WHERE cur_namespace=0 AND cur_is_redirect=0";
        }
        
@@ -34,8 +41,7 @@ class ShortPagesPage extends QueryPage {
        }
 }
 
-function wfSpecialShortpages()
-{
+function wfSpecialShortpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
        $spp = new ShortPagesPage();