Tweak for r29561: don't grab a database object until we need it
[lhc/web/wiklou.git] / includes / SpecialWithoutinterwiki.php
1 <?php
2
3 /**
4 * Special page lists pages without language links
5 *
6 * @package MediaWiki
7 * @addtogroup SpecialPage
8 * @author Rob Church <robchur@gmail.com>
9 */
10 class WithoutInterwikiPage extends PageQueryPage {
11
12 function getName() {
13 return 'Withoutinterwiki';
14 }
15
16 function getPageHeader() {
17 return '<p>' . wfMsgExt( 'withoutinterwiki-header', array( 'parseinline' ) ) . '</p>';
18 }
19
20 function sortDescending() {
21 return false;
22 }
23
24 function isExpensive() {
25 return true;
26 }
27
28 function isSyndicated() {
29 return false;
30 }
31
32 function getSQL() {
33 $dbr = wfGetDB( DB_SLAVE );
34 list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' );
35 return
36 "SELECT 'Withoutinterwiki' AS type,
37 page_namespace AS namespace,
38 page_title AS title,
39 page_title AS value
40 FROM $page
41 LEFT JOIN $langlinks
42 ON ll_from = page_id
43 WHERE ll_title IS NULL
44 AND page_namespace=" . NS_MAIN . "
45 AND page_is_redirect = 0";
46 }
47
48 }
49
50 function wfSpecialWithoutinterwiki() {
51 list( $limit, $offset ) = wfCheckLimits();
52 $wip = new WithoutInterwikiPage();
53 $wip->doQuery( $offset, $limit );
54 }
55
56