2007-06-03 15:18:33 +00:00
|
|
|
<?php
|
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
|
|
|
/**
|
2008-07-19 12:15:07 +00:00
|
|
|
* Undelete a page by fetching it from the archive table
|
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
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Maintenance
|
|
|
|
|
*/
|
2007-06-03 15:18:33 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
$usage = <<<EOT
|
|
|
|
|
Undelete a page
|
|
|
|
|
Usage: php undelete.php [-u <user>] [-r <reason>] <pagename>
|
2007-06-03 15:18:33 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
EOT;
|
2007-06-03 15:18:33 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
$optionsWithArgs = array( 'u', 'r' );
|
|
|
|
|
require_once( 'commandLine.inc' );
|
2007-06-03 15:18:33 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
$user = 'Command line script';
|
|
|
|
|
$reason = '';
|
2007-06-03 15:18:33 +00:00
|
|
|
|
2009-06-24 02:49:24 +00:00
|
|
|
if ( isset( $options['u'] ) ) {
|
|
|
|
|
$user = $options['u'];
|
2007-06-03 15:18:33 +00:00
|
|
|
}
|
2009-06-24 02:49:24 +00:00
|
|
|
if ( isset( $options['r'] ) ) {
|
|
|
|
|
$reason = $options['r'];
|
|
|
|
|
}
|
|
|
|
|
$pageName = @$args[0];
|
|
|
|
|
$title = Title::newFromText( $pageName );
|
|
|
|
|
if ( !$title ) {
|
|
|
|
|
echo $usage;
|
|
|
|
|
exit( 1 );
|
|
|
|
|
}
|
|
|
|
|
$wgUser = User::newFromName( $user );
|
|
|
|
|
$archive = new PageArchive( $title );
|
|
|
|
|
echo "Undeleting " . $title->getPrefixedDBkey() . '...';
|
|
|
|
|
$archive->undelete( array(), $reason );
|
|
|
|
|
echo "done\n";
|
|
|
|
|
|
2007-06-29 01:19:14 +00:00
|
|
|
|