fdd850868f987d6e4ca87e0a7cb3a86641084fec
[lhc/web/wiklou.git] / includes / SpecialDeadendpages.php
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 require_once( "QueryPage.php" );
10
11 /**
12 *
13 */
14 class DeadendPagesPage extends PageQueryPage {
15
16 function getName( ) {
17 return "Deadendpages";
18 }
19
20 /**
21 * LEFT JOIN is expensive
22 *
23 * @return true
24 */
25 function isExpensive( ) {
26 return 1;
27 }
28
29 /**
30 * @return false
31 */
32 function sortDescending() {
33 return false;
34 }
35
36 /**
37 * @return string an sqlquery
38 */
39 function getSQL() {
40 $dbr =& wfGetDB( DB_SLAVE );
41 extract( $dbr->tableNames( 'cur', 'links' ) );
42 return "SELECT 'Deadendpages' as type, cur_namespace AS namespace, cur_title as title, cur_title AS value " .
43 "FROM $cur LEFT JOIN $links ON cur_id = l_from " .
44 "WHERE l_from IS NULL " .
45 "AND cur_namespace = 0 " .
46 "AND cur_is_redirect = 0";
47 }
48 }
49
50 /**
51 * Constructor
52 */
53 function wfSpecialDeadendpages() {
54
55 list( $limit, $offset ) = wfCheckLimits();
56
57 $depp = new DeadendPagesPage();
58
59 return $depp->doQuery( $offset, $limit );
60 }
61
62 ?>