SpecialDeadendpages.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * @file
  4. * @ingroup SpecialPage
  5. */
  6. /**
  7. * @ingroup SpecialPage
  8. */
  9. class DeadendPagesPage extends PageQueryPage {
  10. function getName( ) {
  11. return "Deadendpages";
  12. }
  13. function getPageHeader() {
  14. return wfMsgExt( 'deadendpagestext', array( 'parse' ) );
  15. }
  16. /**
  17. * LEFT JOIN is expensive
  18. *
  19. * @return true
  20. */
  21. function isExpensive( ) {
  22. return 1;
  23. }
  24. function isSyndicated() { return false; }
  25. /**
  26. * @return false
  27. */
  28. function sortDescending() {
  29. return false;
  30. }
  31. /**
  32. * @return string an sqlquery
  33. */
  34. function getSQL() {
  35. $dbr = wfGetDB( DB_SLAVE );
  36. list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' );
  37. return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " .
  38. "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " .
  39. "WHERE pl_from IS NULL " .
  40. "AND page_namespace = 0 " .
  41. "AND page_is_redirect = 0";
  42. }
  43. }
  44. /**
  45. * Constructor
  46. */
  47. function wfSpecialDeadendpages() {
  48. list( $limit, $offset ) = wfCheckLimits();
  49. $depp = new DeadendPagesPage();
  50. return $depp->doQuery( $offset, $limit );
  51. }