MediaWiki  REL1_22
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         return array(
00053             'tables' => array(
00054                 'page', 'pagelinks',
00055                 'templatelinks'
00056             ),
00057             'fields' => array(
00058                 'namespace' => 'page_namespace',
00059                 'title' => 'page_title',
00060                 'value' => 'page_title'
00061             ),
00062             'conds' => array(
00063                 'pl_namespace IS NULL',
00064                 'page_namespace' => MWNamespace::getContentNamespaces(),
00065                 'page_is_redirect' => 0,
00066                 'tl_namespace IS NULL'
00067             ),
00068             'join_conds' => array(
00069                 'pagelinks' => array(
00070                     'LEFT JOIN', array(
00071                         'pl_namespace = page_namespace',
00072                         'pl_title = page_title'
00073                     )
00074                 ),
00075                 'templatelinks' => array(
00076                     'LEFT JOIN', array(
00077                         'tl_namespace = page_namespace',
00078                         'tl_title = page_title'
00079                     )
00080                 )
00081             )
00082         );
00083     }
00084 
00085     function getOrderFields() {
00086         // For some crazy reason ordering by a constant
00087         // causes a filesort in MySQL 5
00088         if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
00089             return array( 'page_namespace', 'page_title' );
00090         } else {
00091             return array( 'page_title' );
00092         }
00093     }
00094 
00095     protected function getGroupName() {
00096         return 'maintenance';
00097     }
00098 }