2007-01-05 18:08:29 +00:00
|
|
|
<?php
|
2009-06-24 02:49:24 +00:00
|
|
|
|
2007-01-05 18:08:29 +00:00
|
|
|
/**
|
|
|
|
|
* Deletes all pages in the MediaWiki namespace which were last edited by
|
|
|
|
|
* "MediaWiki default".
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
*
|
2009-06-24 02:49:24 +00:00
|
|
|
* @file
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Maintenance
|
2007-01-05 18:08:29 +00:00
|
|
|
*/
|
|
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
|
require_once( 'commandLine.inc' );
|
|
|
|
|
deleteDefaultMessages();
|
|
|
|
|
}
|
2007-01-05 18:08:29 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
function deleteDefaultMessages() {
|
|
|
|
|
$user = 'MediaWiki default';
|
|
|
|
|
$reason = 'No longer required';
|
2007-01-05 18:08:29 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
global $wgUser;
|
|
|
|
|
$wgUser = User::newFromName( $user );
|
|
|
|
|
$wgUser->addGroup( 'bot' );
|
|
|
|
|
|
|
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
|
|
|
|
$res = $dbr->select( array( 'page', 'revision' ),
|
|
|
|
|
array( 'page_namespace', 'page_title' ),
|
|
|
|
|
array(
|
|
|
|
|
'page_namespace' => NS_MEDIAWIKI,
|
|
|
|
|
'page_latest=rev_id',
|
|
|
|
|
'rev_user_text' => 'MediaWiki default',
|
|
|
|
|
)
|
|
|
|
|
);
|
2007-01-05 18:08:29 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
$dbw = wfGetDB( DB_MASTER );
|
2007-01-05 18:08:29 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
while ( $row = $dbr->fetchObject( $res ) ) {
|
|
|
|
|
if ( function_exists( 'wfWaitForSlaves' ) ) {
|
|
|
|
|
wfWaitForSlaves( 5 );
|
2007-01-05 18:08:29 +00:00
|
|
|
}
|
2009-06-24 02:49:24 +00:00
|
|
|
$dbw->ping();
|
|
|
|
|
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
|
|
|
|
|
$article = new Article( $title );
|
|
|
|
|
$dbw->begin();
|
|
|
|
|
$article->doDeleteArticle( $reason );
|
|
|
|
|
$dbw->commit();
|
2007-01-05 18:08:29 +00:00
|
|
|
}
|
|
|
|
|
}
|
2007-06-29 01:19:14 +00:00
|
|
|
|