Index: branches/querypage-work/phase3/includes/ImageQueryPage.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | * @ingroup SpecialPage |
9 | 9 | * @author Rob Church <robchur@gmail.com> |
10 | 10 | */ |
11 | | -class ImageQueryPage extends QueryPage { |
| 11 | +abstract class ImageQueryPage extends QueryPage { |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Format and output report results using the given information plus |
— | — | @@ -37,6 +37,9 @@ |
38 | 38 | $out->addHTML( $gallery->toHtml() ); |
39 | 39 | } |
40 | 40 | } |
| 41 | + |
| 42 | + // Gotta override this since it's abstract |
| 43 | + function formatResult( $skin, $result ) { } |
41 | 44 | |
42 | 45 | /** |
43 | 46 | * Prepare an image object given a result row |
Index: branches/querypage-work/phase3/includes/AutoLoader.php |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | 'HTMLCacheUpdate' => 'includes/HTMLCacheUpdate.php', |
91 | 91 | 'HTMLCacheUpdateJob' => 'includes/HTMLCacheUpdate.php', |
92 | 92 | 'HTMLFileCache' => 'includes/HTMLFileCache.php', |
| 93 | + 'HTMLForm' => 'includes/HTMLForm.php', |
93 | 94 | 'Http' => 'includes/HttpFunctions.php', |
94 | 95 | 'IEContentAnalyzer' => 'includes/IEContentAnalyzer.php', |
95 | 96 | 'ImageGallery' => 'includes/ImageGallery.php', |
— | — | @@ -140,6 +141,7 @@ |
141 | 142 | 'PatrolLog' => 'includes/PatrolLog.php', |
142 | 143 | 'PostgresSearchResult' => 'includes/SearchPostgres.php', |
143 | 144 | 'PostgresSearchResultSet' => 'includes/SearchPostgres.php', |
| 145 | + 'Preferences' => 'includes/Preferences.php', |
144 | 146 | 'PrefixSearch' => 'includes/PrefixSearch.php', |
145 | 147 | 'Profiler' => 'includes/Profiler.php', |
146 | 148 | 'ProfilerSimple' => 'includes/ProfilerSimple.php', |
— | — | @@ -202,6 +204,7 @@ |
203 | 205 | 'UserArrayFromResult' => 'includes/UserArray.php', |
204 | 206 | 'UserMailer' => 'includes/UserMailer.php', |
205 | 207 | 'UserRightsProxy' => 'includes/UserRightsProxy.php', |
| 208 | + 'WantedQueryPage' => 'includes/QueryPage.php', |
206 | 209 | 'WatchedItem' => 'includes/WatchedItem.php', |
207 | 210 | 'WatchlistEditor' => 'includes/WatchlistEditor.php', |
208 | 211 | 'WebRequest' => 'includes/WebRequest.php', |
— | — | @@ -485,7 +488,7 @@ |
486 | 489 | 'PageArchive' => 'includes/specials/SpecialUndelete.php', |
487 | 490 | 'SpecialResetpass' => 'includes/specials/SpecialResetpass.php', |
488 | 491 | 'PopularPagesPage' => 'includes/specials/SpecialPopularpages.php', |
489 | | - 'PreferencesForm' => 'includes/specials/SpecialPreferences.php', |
| 492 | + 'PreferencesForm' => 'includes/Preferences.php', |
490 | 493 | 'RandomPage' => 'includes/specials/SpecialRandompage.php', |
491 | 494 | 'SpecialRevisionDelete' => 'includes/specials/SpecialRevisiondelete.php', |
492 | 495 | 'RevisionDeleter' => 'includes/specials/SpecialRevisiondelete.php', |
— | — | @@ -496,6 +499,7 @@ |
497 | 500 | 'SpecialImport' => 'includes/specials/SpecialImport.php', |
498 | 501 | 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php', |
499 | 502 | 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php', |
| 503 | + 'SpecialPreferences' => 'includes/specials/SpecialPreferences.php', |
500 | 504 | 'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php', |
501 | 505 | 'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php', |
502 | 506 | 'SpecialRecentchanges' => 'includes/specials/SpecialRecentchanges.php', |
— | — | @@ -505,6 +509,7 @@ |
506 | 510 | 'SpecialStatistics' => 'includes/specials/SpecialStatistics.php', |
507 | 511 | 'SpecialTags' => 'includes/specials/SpecialTags.php', |
508 | 512 | 'SpecialVersion' => 'includes/specials/SpecialVersion.php', |
| 513 | + 'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php', |
509 | 514 | 'UncategorizedCategoriesPage' => 'includes/specials/SpecialUncategorizedcategories.php', |
510 | 515 | 'UncategorizedPagesPage' => 'includes/specials/SpecialUncategorizedpages.php', |
511 | 516 | 'UncategorizedTemplatesPage' => 'includes/specials/SpecialUncategorizedtemplates.php', |
— | — | @@ -521,7 +526,6 @@ |
522 | 527 | 'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php', |
523 | 528 | 'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php', |
524 | 529 | 'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php', |
525 | | - 'WhatLinksHerePage' => 'includes/specials/SpecialWhatlinkshere.php', |
526 | 530 | 'WikiImporter' => 'includes/Import.php', |
527 | 531 | 'WikiRevision' => 'includes/Import.php', |
528 | 532 | 'WithoutInterwikiPage' => 'includes/specials/SpecialWithoutinterwiki.php', |
Property changes on: branches/querypage-work/phase3/includes/AutoLoader.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
529 | 533 | + /trunk/phase3/includes/AutoLoader.php:49082-50377 |
Index: branches/querypage-work/phase3/includes/specials/SpecialFewestrevisions.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | // useful to remove this. People _do_ create pages |
41 | 41 | // and never revise them, they aren't necessarily |
42 | 42 | // redirects. |
43 | | - 'GROUP BY' => 'page_namespace, page_title' . |
| 43 | + 'GROUP BY' => 'page_namespace, page_title, ' . |
44 | 44 | 'page_is_redirect' ) |
45 | 45 | ); |
46 | 46 | } |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php |
— | — | @@ -33,7 +33,8 @@ |
34 | 34 | 'join_conds' => array ( 'page' => array ( 'LEFT JOIN', |
35 | 35 | array ( 'page_namespace = tl_namespace', |
36 | 36 | 'page_title = tl_title' ) ) ) |
37 | | - ); |
| 37 | + ); |
| 38 | + } |
38 | 39 | } |
39 | 40 | |
40 | 41 | /** |
Index: branches/querypage-work/phase3/includes/specials/SpecialBrokenRedirects.php |
— | — | @@ -34,7 +34,6 @@ |
35 | 35 | 'conds' => array( 'rd_namespace >= 0', |
36 | 36 | 'p2.page_namespace IS NULL' |
37 | 37 | ), |
38 | | - // TODO test this join |
39 | 38 | 'join_conds' => array( 'page AS p1' => array( 'LEFT JOIN', array( |
40 | 39 | 'rd_from=p1.page_id', |
41 | 40 | ) ), |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostcategories.php |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ), |
29 | 29 | 'options' => array ( 'HAVING' => 'COUNT(*) > 1', |
30 | 30 | 'GROUP BY' => 'page_namespace, page_title' ), |
31 | | - // TODO: test this JOIN |
32 | 31 | 'join_conds' => array ( 'page' => array ( 'LEFT JOIN', |
33 | 32 | 'page_id = cl_from' ) ) |
34 | 33 | ); |
Index: branches/querypage-work/phase3/includes/specials/SpecialLonelypages.php |
— | — | @@ -38,7 +38,6 @@ |
39 | 39 | 'page_namespace' => MWNamespace::getContentNamespaces(), |
40 | 40 | 'page_is_redirect' => 0, |
41 | 41 | 'tl_namespace IS NULL' ), |
42 | | - // TODO: test this JOIN |
43 | 42 | 'join_conds' => array ( |
44 | 43 | 'pagelinks' => array ( |
45 | 44 | 'LEFT JOIN', array ( |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedtemplates.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'fields' => array ( 'tl_namespace AS namespace', |
57 | 57 | 'tl_title AS title', |
58 | 58 | 'COUNT(*) AS value' ), |
59 | | - 'conds' => array ( 'tl_namespace' => NS_TEMPLATE' ), |
| 59 | + 'conds' => array ( 'tl_namespace' => NS_TEMPLATE ), |
60 | 60 | 'options' => array( 'GROUP BY' => 'tl_title' ) |
61 | 61 | ); |
62 | 62 | } |
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedtemplates.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | '0 AS value' ), |
28 | 28 | 'conds' => array ( 'page_namespace' => NS_TEMPLATE, |
29 | 29 | 'tl_from IS NULL', |
30 | | - 'page_redirect' => 0 ), |
| 30 | + 'page_is_redirect' => 0 ), |
31 | 31 | 'join_conds' => array ( 'templatelinks' => array ( |
32 | 32 | 'LEFT JOIN', array ( 'tl_title = page_title', |
33 | 33 | 'tl_namespace = page_namespace' ) ) ) |
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedimages.php |
— | — | @@ -39,6 +39,20 @@ |
40 | 40 | FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from |
41 | 41 | WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0"; |
42 | 42 | } |
| 43 | + |
| 44 | + function getQueryInfo() { |
| 45 | + return array ( |
| 46 | + 'tables' => array( 'page', 'categorylinks' ), |
| 47 | + 'fields' => array( 'page_namespace AS namespace', |
| 48 | + 'page_title AS title', |
| 49 | + 'page_title AS value' ), |
| 50 | + 'conds' => array( 'cl_from IS NULL', |
| 51 | + 'page_namespace' => NS_FILE, |
| 52 | + 'page_is_redirect' => 0 ), |
| 53 | + 'join_conds' => array( 'categorylinks' => array( |
| 54 | + 'LEFT JOIN', 'cl_from=page_id' ) ) |
| 55 | + ); |
| 56 | + } |
43 | 57 | |
44 | 58 | } |
45 | 59 | |
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php |
— | — | @@ -61,11 +61,10 @@ |
62 | 62 | NS_MEDIAWIKI . "'" ), |
63 | 63 | 'options' => array ( 'HAVING' => "COUNT(*) > $count", |
64 | 64 | 'GROUP BY' => 'pl_namespace, pl_title' ), |
65 | | - // TODO: test this join |
66 | 65 | 'join_conds' => array ( 'page AS pg1' => array ( |
67 | 66 | 'LEFT JOIN', array ( |
68 | 67 | 'pg1.page_namespace = pl_namespace', |
69 | | - 'pg2.page_title = pl_title' ) ), |
| 68 | + 'pg1.page_title = pl_title' ) ), |
70 | 69 | 'page AS pg2' => array ( 'LEFT JOIN', |
71 | 70 | 'pg2.page_id = pl_from' ) ) |
72 | 71 | ); |
Index: branches/querypage-work/phase3/includes/QueryPage.php |
— | — | @@ -310,7 +310,7 @@ |
311 | 311 | $field .= ' DESC'; |
312 | 312 | } |
313 | 313 | } |
314 | | - if( !is_array( $query['options'] ) ) { |
| 314 | + if( !is_array( @$query['options'] ) ) { |
315 | 315 | $options = array (); |
316 | 316 | } |
317 | 317 | if( count( $order ) ) { |
— | — | @@ -324,10 +324,10 @@ |
325 | 325 | } |
326 | 326 | |
327 | 327 | $dbr = wfGetDB( DB_SLAVE ); |
328 | | - $res = $dbr->select( (array)$query['tables'], |
329 | | - (array)$query['fields'], |
330 | | - (array)$query['conds'], $fname, |
331 | | - $query['options'], (array)$query['join_conds'] |
| 328 | + $res = $dbr->select( (array)@$query['tables'], |
| 329 | + (array)@$query['fields'], |
| 330 | + (array)@$query['conds'], $fname, |
| 331 | + $query['options'], (array)@$query['join_conds'] |
332 | 332 | ); |
333 | 333 | return $dbr->resultObject( $res ); |
334 | 334 | } |
Index: branches/querypage-work/TODO |
— | — | @@ -1,12 +1,10 @@ |
2 | | -* Test JOINs using table aliases |
3 | 2 | * Make INNER JOIN implicit in Unusedimages? |
4 | 3 | * Find and migrate code using WantedPages::getSQL hook |
5 | 4 | * Check sorting sanity |
6 | 5 | ** Check whether sorts are efficient and page right |
7 | 6 | ** Check whether sorting by nothing is really what we want |
8 | 7 | ** Check whether selecting title or ns AS value is really what we want |
| 8 | +* Track down and fix pages querying page info one title at a time |
9 | 9 | * Mark ShortPages as inexpensive |
10 | 10 | * Reuse UncategorizedPages code in UncategorizedImages somehow |
11 | 11 | * Make UncategorizedPages parameterized by namespace |
12 | | - |
13 | | -* Convert UncategorizedImages |