summaryrefslogtreecommitdiff
path: root/maintenance/undelete.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
committerPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
commit8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch)
treecd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /maintenance/undelete.php
parentd7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff)
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'maintenance/undelete.php')
-rw-r--r--maintenance/undelete.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/maintenance/undelete.php b/maintenance/undelete.php
new file mode 100644
index 00000000..c9a2f9ed
--- /dev/null
+++ b/maintenance/undelete.php
@@ -0,0 +1,33 @@
+<?php
+
+$usage = <<<EOT
+Undelete a page
+Usage: php undelete.php [-u <user>] [-r <reason>] <pagename>
+
+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";
+
+