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