4 * Deletes all pages in the MediaWiki namespace which were last edited by
11 if ( !defined( 'MEDIAWIKI' ) ) {
12 require_once( 'commandLine.inc' );
13 deleteDefaultMessages();
16 function deleteDefaultMessages() {
17 $user = 'MediaWiki default';
18 $reason = 'No longer required';
21 $wgUser = User
::newFromName( $user );
22 $wgUser->addGroup( 'bot' );
24 $dbr = wfGetDB( DB_SLAVE
);
25 $res = $dbr->select( array( 'page', 'revision' ),
26 array( 'page_namespace', 'page_title' ),
28 'page_namespace' => NS_MEDIAWIKI
,
30 'rev_user_text' => 'MediaWiki default',
34 $dbw = wfGetDB( DB_MASTER
);
36 while ( $row = $dbr->fetchObject( $res ) ) {
37 if ( function_exists( 'wfWaitForSlaves' ) ) {
41 $title = Title
::makeTitle( $row->page_namespace
, $row->page_title
);
42 $article = new Article( $title );
44 $article->doDeleteArticle( $reason );