5 Usage: php undelete.php [-u <user>] [-r <reason>] <pagename>
9 $optionsWithArgs = array( 'u', 'r' );
10 require_once( 'commandLine.inc' );
12 $user = 'Command line script';
15 if ( isset( $options['u'] ) ) {
16 $user = $options['u'];
18 if ( isset( $options['r'] ) ) {
19 $reason = $options['r'];
21 $pageName = @$args[0];
22 $title = Title
::newFromText( $pageName );
27 $wgUser = User
::newFromName( $user );
28 $archive = new PageArchive( $title );
29 echo "Undeleting " . $title->getPrefixedDBkey() . '...';
30 $archive->undelete( array(), $reason );