MediaWiki  REL1_22
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(
00047                 'page_namespace' => NS_MAIN,
00048                 'page_is_redirect' => 0,
00049             ),
00050             __METHOD__ );
00051 
00052         foreach ( $result as $row ) {
00053             $title = Title::makeTitle( $row->page_namespace, $row->page_title );
00054             $url = $title->getFullURL();
00055             $text = $title->getPrefixedText();
00056             $this->output( "$url $text\n" );
00057         }
00058     }
00059 }
00060 
00061 $maintClass = "DumpSisterSites";
00062 require_once RUN_MAINTENANCE_IF_MAIN;