Index: branches/querypage-work/phase3/includes/QueryPage.php |
— | — | @@ -112,8 +112,8 @@ |
113 | 113 | * options => options |
114 | 114 | * join_conds => JOIN conditions |
115 | 115 | * |
116 | | - * Note that the query itself should return the following four columns: |
117 | | - * 'type' (your special page's name), 'namespace', 'title', and 'value' |
| 116 | + * Note that the query itself should return the following three columns: |
| 117 | + * 'namespace', 'title', and 'value' |
118 | 118 | * *in that order*. 'value' is used for sorting. |
119 | 119 | * |
120 | 120 | * These may be stored in the querycache table for expensive queries, |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | $value = 0; |
267 | 267 | } |
268 | 268 | |
269 | | - $vals[] = array('qc_type' => $row->type, |
| 269 | + $vals[] = array('qc_type' => $this->getName(), |
270 | 270 | 'qc_namespace' => $row->namespace, |
271 | 271 | 'qc_title' => $row->title, |
272 | 272 | 'qc_value' => $value); |
— | — | @@ -386,7 +386,7 @@ |
387 | 387 | if( !$this->listoutput ) { |
388 | 388 | |
389 | 389 | # Fetch the timestamp of this update |
390 | | - $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $type ), $fname ); |
| 390 | + $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $sname ), $fname ); |
391 | 391 | $tRow = $dbr->fetchObject( $tRes ); |
392 | 392 | |
393 | 393 | if( $tRow ) { |
Index: branches/querypage-work/phase3/includes/specials/SpecialFewestrevisions.php |
— | — | @@ -27,8 +27,7 @@ |
28 | 28 | function getQueryInfo() { |
29 | 29 | return array ( |
30 | 30 | 'tables' => array ( 'revision', 'page' ), |
31 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
32 | | - 'page_namespace AS namespace', |
| 31 | + 'fields' => array ( 'page_namespace AS namespace', |
33 | 32 | 'page_title AS title', |
34 | 33 | 'COUNT(*) AS value', |
35 | 34 | 'page_is_redirect AS redirect' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php |
— | — | @@ -23,8 +23,7 @@ |
24 | 24 | function getQueryInfo() { |
25 | 25 | return array ( |
26 | 26 | 'tables' => array ( 'templatelinks', 'page' ), |
27 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
28 | | - 'tl_namespace AS namespace', |
| 27 | + 'fields' => array ( 'tl_namespace AS namespace', |
29 | 28 | 'tl_title AS title', |
30 | 29 | 'COUNT(*) AS value' ), |
31 | 30 | 'conds' => array ( 'page_title IS NULL', |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinked.php |
— | — | @@ -28,8 +28,7 @@ |
29 | 29 | function getQueryInfo() { |
30 | 30 | return array ( |
31 | 31 | 'tables' => array ( 'pagelinks', 'page' ), |
32 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
33 | | - 'pl_namespace AS namespace', |
| 32 | + 'fields' => array ( 'pl_namespace AS namespace', |
34 | 33 | 'pl_title AS title', |
35 | 34 | 'COUNT(*) AS value', |
36 | 35 | 'page_namespace' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialDisambiguations.php |
— | — | @@ -120,8 +120,7 @@ |
121 | 121 | // FIXME: What are pagelinks and p2 doing here? |
122 | 122 | return array ( |
123 | 123 | 'tables' => array( 'templatelinks', 'page AS p1', 'pagelinks', 'page AS p2' ), |
124 | | - 'fields' => array( "'{$this->getName()}' AS type", |
125 | | - 'p1.page_namespace AS namespace', |
| 124 | + 'fields' => array( 'p1.page_namespace AS namespace', |
126 | 125 | 'p1.page_title AS title', |
127 | 126 | 'pl_from AS value' ), |
128 | 127 | 'conds' => array( $set, |
Index: branches/querypage-work/phase3/includes/specials/SpecialBrokenRedirects.php |
— | — | @@ -26,8 +26,7 @@ |
27 | 27 | function getQueryInfo() { |
28 | 28 | return array( |
29 | 29 | 'tables' => array( 'redirect', 'page AS p1', 'page AS p2' ), |
30 | | - 'fields' => array( "'{$this->getName()}' AS type", |
31 | | - 'p1.page_namespace AS namespace', |
| 30 | + 'fields' => array( 'p1.page_namespace AS namespace', |
32 | 31 | 'p1.page_title AS title', |
33 | 32 | 'rd_namespace', |
34 | 33 | 'rd_title' |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedfiles.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'imagelinks', 'page' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - "'" . NS_FILE . "' AS namespace", |
| 26 | + 'fields' => array ( "'" . NS_FILE . "' AS namespace", |
28 | 27 | 'il_to AS title', |
29 | 28 | 'COUNT(*) AS value' ), |
30 | 29 | 'conds' => array ( 'page_title IS NULL' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedcategories.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'page', 'categorylinks' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - 'page_namespace AS namespace', |
| 26 | + 'fields' => array ( 'page_namespace AS namespace', |
28 | 27 | 'page_title AS title', |
29 | 28 | 'page_title AS value' ), |
30 | 29 | 'conds' => array ( 'cl_from IS NULL', |
Index: branches/querypage-work/phase3/includes/specials/SpecialListredirects.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'page' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - 'page_namespace AS namespace', |
| 26 | + 'fields' => array ( 'page_namespace AS namespace', |
28 | 27 | 'page_title AS title' ), |
29 | 28 | 'conds' => array ( 'page_is_redirect' => 1 ) |
30 | 29 | ); |
Index: branches/querypage-work/phase3/includes/specials/SpecialLonelypages.php |
— | — | @@ -31,8 +31,7 @@ |
32 | 32 | return array ( |
33 | 33 | 'tables' => array ( 'page', 'pagelinks', |
34 | 34 | 'templatelinks' ), |
35 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
36 | | - 'page_namespace AS namespace', |
| 35 | + 'fields' => array ( 'page_namespace AS namespace', |
37 | 36 | 'page_title AS title', |
38 | 37 | 'page_title AS value' ), |
39 | 38 | 'conds' => array ( 'pl_namespace IS NULL', |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedtemplates.php |
— | — | @@ -52,8 +52,7 @@ |
53 | 53 | public function getQueryInfo() { |
54 | 54 | return array ( |
55 | 55 | 'tables' => array ( 'templatelinks' ), |
56 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
57 | | - 'tl_namespace AS namespace', |
| 56 | + 'fields' => array ( 'tl_namespace AS namespace', |
58 | 57 | 'tl_title AS title', |
59 | 58 | 'COUNT(*) AS value' ), |
60 | 59 | 'conds' => array ( 'tl_namespace' => NS_TEMPLATE' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostcategories.php |
— | — | @@ -21,8 +21,7 @@ |
22 | 22 | function getQueryInfo() { |
23 | 23 | return array ( |
24 | 24 | 'tables' => array ( 'categorylinks', 'page' ), |
25 | | - 'fields' => array ( "'{$this->getName()}' AS name", |
26 | | - 'page_namespace AS namespace', |
| 25 | + 'fields' => array ( 'page_namespace AS namespace', |
27 | 26 | 'page_title AS title', |
28 | 27 | 'COUNT(*) AS value' ), |
29 | 28 | 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedcategories.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'categorylinks', 'page' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - "'" . NS_CATEGORY . "' AS namespace", |
| 26 | + 'fields' => array ( "'" . NS_CATEGORY . "' AS namespace", |
28 | 27 | 'cl_to AS title', |
29 | 28 | 'COUNT(*) AS value' ), |
30 | 29 | 'conds' => array ( 'page_title IS NULL' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedimages.php |
— | — | @@ -25,8 +25,7 @@ |
26 | 26 | global $wgCountCategorizedImagesAsUsed; |
27 | 27 | $retval = array ( |
28 | 28 | 'tables' => array ( 'image', 'imagelinks' ), |
29 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
30 | | - "'" . NS_FILE . "' AS namespace", |
| 29 | + 'fields' => array ( "'" . NS_FILE . "' AS namespace", |
31 | 30 | 'img_name AS title', |
32 | 31 | 'img_timestamp AS value', |
33 | 32 | 'img_user', 'img_user_text', |
Index: branches/querypage-work/phase3/includes/specials/SpecialWithoutinterwiki.php |
— | — | @@ -53,8 +53,7 @@ |
54 | 54 | function getQueryInfo() { |
55 | 55 | $query = array ( |
56 | 56 | 'tables' => array ( 'page', 'langlinks' ), |
57 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
58 | | - 'page_namespace AS namespace', |
| 57 | + 'fields' => array ( 'page_namespace AS namespace', |
59 | 58 | 'page_title AS title', |
60 | 59 | 'page_title AS value' ), |
61 | 60 | 'conds' => array ( 'll_title IS NULL' ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialAncientpages.php |
— | — | @@ -21,11 +21,9 @@ |
22 | 22 | function isSyndicated() { return false; } |
23 | 23 | |
24 | 24 | function getQueryInfo() { |
25 | | - // FIXME standardize 'name' AS type ? |
26 | 25 | return array( |
27 | 26 | 'tables' => array( 'page', 'revision' ), |
28 | | - 'fields' => array( "'{$this->getName()}' AS type", |
29 | | - 'page_namespace AS namespace', |
| 27 | + 'fields' => array( 'page_namespace AS namespace', |
30 | 28 | 'page_title AS title', |
31 | 29 | 'rev_timestamp AS value' ), |
32 | 30 | 'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces(), |
Index: branches/querypage-work/phase3/includes/specials/SpecialUnwatchedpages.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'page', 'watchlist' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - 'page_namespace AS namespace', |
| 26 | + 'fields' => array ( 'page_namespace AS namespace', |
28 | 27 | 'page_title AS title', |
29 | 28 | 'page_namespace AS value' ), |
30 | 29 | 'conds' => array ( 'wl_title IS NULL', |
Index: branches/querypage-work/phase3/includes/specials/SpecialDeadendpages.php |
— | — | @@ -38,8 +38,7 @@ |
39 | 39 | function getQueryInfo() { |
40 | 40 | return array( |
41 | 41 | 'tables' => array( 'page', 'pagelinks' ), |
42 | | - 'fields' => array( "'{$this->getName()}' AS type", |
43 | | - 'page_namespace AS namespace', |
| 42 | + 'fields' => array( 'page_namespace AS namespace', |
44 | 43 | 'page_title AS title', |
45 | 44 | 'page_title AS value' |
46 | 45 | ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostimages.php |
— | — | @@ -21,8 +21,7 @@ |
22 | 22 | function getQueryInfo() { |
23 | 23 | return array ( |
24 | 24 | 'tables' => array ( 'imagelinks' ), |
25 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
26 | | - "'" . NS_FILE . "' AS namespace", |
| 25 | + 'fields' => array ( "'" . NS_FILE . "' AS namespace", |
27 | 26 | 'il_to AS title', |
28 | 27 | 'COUNT(*) AS value' ), |
29 | 28 | 'options' => array ( 'GROUP BY' => 'il_to', |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedcategories.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | function getQueryInfo() { |
24 | 24 | return array ( |
25 | 25 | 'tables' => array ( 'categorylinks' ), |
26 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
27 | | - "'" . NS_CATEGORY . "' AS namespace", |
| 26 | + 'fields' => array ( "'" . NS_CATEGORY . "' AS namespace", |
28 | 27 | 'cl_to AS title', |
29 | 28 | 'COUNT(*) AS value' ), |
30 | 29 | 'options' => array ( 'GROUP BY' => 'cl_to' ) |
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedtemplates.php |
— | — | @@ -21,8 +21,7 @@ |
22 | 22 | function getQueryInfo() { |
23 | 23 | return array ( |
24 | 24 | 'tables' => array ( 'page', 'templatelinks' ), |
25 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
26 | | - 'page_namespace AS namespace', |
| 25 | + 'fields' => array ( 'page_namespace AS namespace', |
27 | 26 | 'page_title AS title', |
28 | 27 | '0 AS value' ), |
29 | 28 | 'conds' => array ( 'page_namespace' => NS_TEMPLATE, |
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedpages.php |
— | — | @@ -28,8 +28,7 @@ |
29 | 29 | function getQueryInfo() { |
30 | 30 | return array ( |
31 | 31 | 'tables' => array ( 'page', 'categorylinks' ), |
32 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
33 | | - 'page_namespace AS namespace', |
| 32 | + 'fields' => array ( 'page_namespace AS namespace', |
34 | 33 | 'page_title AS title', |
35 | 34 | 'page_title AS value' ), |
36 | 35 | // default for page_namespace is all content namespaces (if requestedNamespace is false) |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php |
— | — | @@ -51,8 +51,7 @@ |
52 | 52 | $query = array ( |
53 | 53 | 'tables' => array ( 'pagelinks', 'page AS pg1', |
54 | 54 | 'page AS pg2' ), |
55 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
56 | | - 'pl_namespace AS namespace', |
| 55 | + 'fields' => array ( 'pl_namespace AS namespace', |
57 | 56 | 'pl_title AS title', |
58 | 57 | 'COUNT(*) AS value' ), |
59 | 58 | 'conds' => array ( 'pg1.page_namespace IS NULL', |
Index: branches/querypage-work/phase3/includes/specials/SpecialShortpages.php |
— | — | @@ -30,8 +30,7 @@ |
31 | 31 | function getQueryInfo() { |
32 | 32 | return array ( |
33 | 33 | 'tables' => array ( 'page' ), |
34 | | - 'fields' => array ( "'{$this->getName()}' AS type", |
35 | | - 'page_namespace AS namespace', |
| 34 | + 'fields' => array ( 'page_namespace AS namespace', |
36 | 35 | 'page_title AS title', |
37 | 36 | 'page_len AS value' ), |
38 | 37 | 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces(), |
Index: branches/querypage-work/phase3/includes/specials/SpecialDoubleRedirects.php |
— | — | @@ -28,8 +28,7 @@ |
29 | 29 | 'tables' => array ( 'redirect AS ra', 'redirect AS rb', |
30 | 30 | 'page AS pa', 'page AS pb', |
31 | 31 | 'page AS pc' ), |
32 | | - 'fields' => array ( '"{$this->getName()}" AS type', |
33 | | - 'pa.page_namespace AS namespace', |
| 32 | + 'fields' => array ( 'pa.page_namespace AS namespace', |
34 | 33 | 'pa.page_title AS title', |
35 | 34 | 'pb.page_namespace AS nsb', |
36 | 35 | 'pb.page_title AS tb', |
Index: branches/querypage-work/TODO |
— | — | @@ -5,8 +5,8 @@ |
6 | 6 | ** Check whether sorts are efficient and page right |
7 | 7 | ** Check whether sorting by nothing is really what we want |
8 | 8 | ** Check whether selecting title or ns AS value is really what we want |
9 | | -* Replace $result->type with getName(), remove type from queries |
10 | 9 | * Mark ShortPages as inexpensive |
11 | 10 | * Reuse UncategorizedPages code in UncategorizedImages somehow |
12 | 11 | * Make UncategorizedPages parameterized by namespace |
13 | 12 | |
| 13 | +* Convert UncategorizedImages |