From: Tim Starling Date: Sun, 3 Jun 2007 15:18:33 +0000 (+0000) Subject: Script to undelete a page X-Git-Tag: 1.31.0-rc.0~52709 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=843959017e5774fe59dc65445676a40613d31efd;p=lhc%2Fweb%2Fwiklou.git Script to undelete a page --- 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"; + +?>