r22679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22678‎ | r22679 | r22680 >
Date:15:18, 3 June 2007
Author:tstarling
Status:old
Tags:
Comment:
Script to undelete a page
Modified paths:
  • /trunk/phase3/maintenance/undelete.php (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/undelete.php
@@ -0,0 +1,33 @@
 2+<?php
 3+
 4+$usage = <<<EOT
 5+Undelete a page
 6+Usage: php undelete.php [-u <user>] [-r <reason>] <pagename>
 7+
 8+EOT;
 9+
 10+$optionsWithArgs = array( 'u', 'r' );
 11+require_once( 'commandLine.inc' );
 12+
 13+$user = 'Command line script';
 14+$reason = '';
 15+
 16+if ( isset( $options['u'] ) ) {
 17+ $user = $options['u'];
 18+}
 19+if ( isset( $options['r'] ) ) {
 20+ $reason = $options['r'];
 21+}
 22+$pageName = $args[0];
 23+$title = Title::newFromText( $pageName );
 24+if ( !$title ) {
 25+ echo $usage;
 26+ exit 1;
 27+}
 28+$wgUser = User::newFromName( $user );
 29+$archive = new PageArchive( $title );
 30+echo "Undeleting " . $title->getPrefixedDBkey() . '...';
 31+$archive->undelete( array(), $reason );
 32+echo "done\n";
 33+
 34+?>
Property changes on: trunk/phase3/maintenance/undelete.php
___________________________________________________________________
Added: svn:eol-style
135 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r22717Merged revisions 22667-22715 via svnmerge from...david20:00, 4 June 2007

Status & tagging log