From 843959017e5774fe59dc65445676a40613d31efd Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 3 Jun 2007 15:18:33 +0000 Subject: [PATCH] Script to undelete a page --- maintenance/undelete.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 maintenance/undelete.php diff --git a/maintenance/undelete.php b/maintenance/undelete.php new file mode 100644 index 0000000000..659cdbf8f1 --- /dev/null +++ b/maintenance/undelete.php @@ -0,0 +1,33 @@ +] [-r ] + +EOT; + +$optionsWithArgs = array( 'u', 'r' ); +require_once( 'commandLine.inc' ); + +$user = 'Command line script'; +$reason = ''; + +if ( isset( $options['u'] ) ) { + $user = $options['u']; +} +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"; + +?> -- 2.20.1