MediaWiki  REL1_21
dumpSisterSites.php
Go to the documentation of this file.
00001 <?php
00028 require_once( __DIR__ . '/Maintenance.php' );
00029 
00035 class DumpSisterSites extends Maintenance {
00036         public function __construct() {
00037                 parent::__construct();
00038                 $this->mDescription = "Quickie page name dump script for SisterSites usage";
00039         }
00040 
00041         public function execute() {
00042                 $dbr = wfGetDB( DB_SLAVE );
00043                 $dbr->bufferResults( false );
00044                 $result = $dbr->select( 'page',
00045                         array( 'page_namespace', 'page_title' ),
00046                         array( 'page_namespace'   => NS_MAIN,
00047                                    'page_is_redirect' => 0,
00048                         ),
00049                         __METHOD__ );
00050 
00051                 foreach ( $result as $row ) {
00052                         $title = Title::makeTitle( $row->page_namespace, $row->page_title );
00053                         $url = $title->getFullUrl();
00054                         $text = $title->getPrefixedText();
00055                         $this->output( "$url $text\n" );
00056                 }
00057         }
00058 }
00059 
00060 $maintClass = "DumpSisterSites";
00061 require_once( RUN_MAINTENANCE_IF_MAIN );