\n to eof
[lhc/web/wiklou.git] / maintenance / rollbackEdits.php
index 5d6a80a..c7f6aa7 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname(__FILE__) . '/Maintenance.php' );
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class RollbackEdits extends Maintenance {
        public function __construct() {
@@ -36,7 +36,7 @@ class RollbackEdits extends Maintenance {
        public function execute() {
                $user = $this->getOption( 'user' );
                $username = User::isIP( $user ) ? $user : User::getCanonicalName( $user );
-               if( !$username ) {
+               if ( !$username ) {
                        $this->error( 'Invalid username', true );
                }
 
@@ -44,10 +44,10 @@ class RollbackEdits extends Maintenance {
                $summary = $this->getOption( 'summary', $this->mSelf . ' mass rollback' );
                $titles = array();
                $results = array();
-               if( $this->hasOption( 'titles' ) ) {
-                       foreach( explode( '|', $this->getOption( 'titles' ) ) as $title ) {
+               if ( $this->hasOption( 'titles' ) ) {
+                       foreach ( explode( '|', $this->getOption( 'titles' ) ) as $title ) {
                                $t = Title::newFromText( $title );
-                               if( !$t ) {
+                               if ( !$t ) {
                                        $this->error( 'Invalid title, ' . $title );
                                } else {
                                        $titles[] = $t;
@@ -57,15 +57,15 @@ class RollbackEdits extends Maintenance {
                        $titles = $this->getRollbackTitles( $user );
                }
 
-               if( !$titles ) {
+               if ( !$titles ) {
                        $this->output( 'No suitable titles to be rolled back' );
                        return;
                }
 
-               foreach( $titles as $t ) {
+               foreach ( $titles as $t ) {
                        $a = new Article( $t );
                        $this->output( 'Processing ' . $t->getPrefixedText() . '...' );
-                       if( !$a->commitRollback( $user, $summary, $bot, $results ) ) {
+                       if ( !$a->commitRollback( $user, $summary, $bot, $results ) ) {
                                $this->output( "done\n" );
                        } else {
                                $this->output( "failed\n" );
@@ -86,7 +86,7 @@ class RollbackEdits extends Maintenance {
                        array( 'page_latest = rev_id', 'rev_user_text' => $user ),
                        __METHOD__
                );
-               while( $row = $dbr->fetchObject( $results ) ) {
+               while ( $row = $dbr->fetchObject( $results ) ) {
                        $titles[] = Title::makeTitle( $row->page_namespace, $row->page_title );
                }
                return $titles;