MediaWiki  REL1_21
SpecialLonelypages.php
Go to the documentation of this file.
00001 <?php
00030 class LonelyPagesPage extends PageQueryPage {
00031 
00032         function __construct( $name = 'Lonelypages' ) {
00033                 parent::__construct( $name );
00034         }
00035 
00036         function getPageHeader() {
00037                 return $this->msg( 'lonelypagestext' )->parseAsBlock();
00038         }
00039 
00040         function sortDescending() {
00041                 return false;
00042         }
00043 
00044         function isExpensive() {
00045                 return true;
00046         }
00047 
00048         function isSyndicated() {
00049                 return false;
00050         }
00051 
00052         function getQueryInfo() {
00053                 return array (
00054                         'tables' => array ( 'page', 'pagelinks',
00055                                         'templatelinks' ),
00056                         'fields' => array ( 'namespace' => 'page_namespace',
00057                                         'title' => 'page_title',
00058                                         'value' => 'page_title' ),
00059                         'conds' => array ( 'pl_namespace IS NULL',
00060                                         'page_namespace' => MWNamespace::getContentNamespaces(),
00061                                         'page_is_redirect' => 0,
00062                                         'tl_namespace IS NULL' ),
00063                         'join_conds' => array (
00064                                         'pagelinks' => array (
00065                                                 'LEFT JOIN', array (
00066                                                 'pl_namespace = page_namespace',
00067                                                 'pl_title = page_title' ) ),
00068                                         'templatelinks' => array (
00069                                                 'LEFT JOIN', array (
00070                                                 'tl_namespace = page_namespace',
00071                                                 'tl_title = page_title' ) ) )
00072                 );
00073         }
00074 
00075         function getOrderFields() {
00076                 // For some crazy reason ordering by a constant
00077                 // causes a filesort in MySQL 5
00078                 if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
00079                         return array( 'page_namespace', 'page_title' );
00080                 } else {
00081                         return array( 'page_title' );
00082                 }
00083         }
00084 
00085         protected function getGroupName() {
00086                 return 'maintenance';
00087         }
00088 }