X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.inc;h=8ac7f919ee1c9ba8020f296952e82b630de44ee8;hb=670c94ebf528155b9a9017784591e23ef57b9884;hp=c657c03f7bf7bfdc3564a062fade439cf3f910dc;hpb=1dd2e07276e1deaf431ddb01c92111038f9e2cd6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index c657c03f7b..8ac7f919ee 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -47,7 +47,7 @@ class UserOptions { */ function __construct( $opts, $args ) { if ( !$this->checkOpts( $opts, $args ) ) { - UserOptions::showUsageAndExit(); + self::showUsageAndExit(); } else { $this->mReady = $this->initializeOpts( $opts, $args ); } @@ -82,7 +82,6 @@ class UserOptions { * @return bool */ private function initializeOpts( $opts, $args ) { - $this->mQuick = isset( $opts['nowarn'] ); $this->mQuiet = isset( $opts['quiet'] ); $this->mDry = isset( $opts['dry'] ); @@ -107,6 +106,7 @@ class UserOptions { /** * Dumb stuff to run a mode. + * @return bool */ public function run() { if ( !$this->mReady ) { @@ -149,12 +149,10 @@ class UserOptions { ); foreach ( $result as $id ) { - $user = User::newFromId( $id->user_id ); // Get the options and update stats if ( $this->mAnOption ) { - if ( !array_key_exists( $this->mAnOption, $defaultOptions ) ) { print "Invalid user option. Use --list to see valid choices\n"; exit; @@ -203,14 +201,12 @@ class UserOptions { ); foreach ( $result as $id ) { - $user = User::newFromId( $id->user_id ); $curValue = $user->getOption( $this->mAnOption ); $username = $user->getName(); if ( $curValue == $this->mOldValue ) { - if ( !$this->mQuiet ) { print "Setting {$this->mAnOption} for $username from '{$this->mOldValue}' " . "to '{$this->mNewValue}'): "; @@ -279,7 +275,6 @@ USAGE; * @return bool */ public function warn() { - if ( $this->mQuick ) { return true; }