X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.inc;h=ddbda49cd203c0b900d218099c2af87d51ec23f3;hb=c752c43a374a49fe77dacac5a0a514c5a43f838b;hp=2a0665793e5ebdd1c6bea7928273899a35e1fc74;hpb=b0cb8e159236e8e57edcc36f0f1dfb303a5acf11;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 2a0665793e..ddbda49cd2 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -38,7 +38,7 @@ class userOptions { public $mOldValue; public $mNewValue; - private $mMode, $mReady ; + private $mMode, $mReady; /** Constructor. Will show usage and exit if script options are not correct */ function __construct( $opts, $args ) { @@ -60,9 +60,9 @@ class userOptions { */ private function checkOpts( $opts, $args ) { // The three possible ways to run the script: - $list = isset( $opts['list'] ); - $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); - $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ) ; + $list = isset( $opts['list'] ); + $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); + $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ); // We want only one of them $isValid = ( ( $list + $usage + $change ) == 1 ); @@ -82,18 +82,18 @@ class userOptions { $this->mQuick = isset( $opts['nowarn'] ); $this->mQuiet = isset( $opts['quiet'] ); - $this->mDry = isset( $opts['dry'] ); + $this->mDry = isset( $opts['dry'] ); // Set object properties, specially 'mMode' used by run() if ( isset( $opts['list'] ) ) { - $this->mMode = 'LISTER' ; + $this->mMode = 'LISTER'; } elseif ( isset( $opts['usage'] ) ) { - $this->mMode = 'USAGER' ; - $this->mAnOption = isset( $args[0] ) ? $args[0] : false ; + $this->mMode = 'USAGER'; + $this->mAnOption = isset( $args[0] ) ? $args[0] : false; } elseif ( isset( $opts['old'] ) && isset( $opts['new'] ) ) { - $this->mMode = 'CHANGER' ; - $this->mOldValue = $opts['old'] ; - $this->mNewValue = $opts['new'] ; + $this->mMode = 'CHANGER'; + $this->mOldValue = $opts['old']; + $this->mNewValue = $opts['new']; $this->mAnOption = $args[0]; } else { die( "There is a bug in the software, this should never happen\n" ); @@ -108,7 +108,7 @@ class userOptions { return false; } - $this->{ $this->mMode } ( ); + $this->{ $this->mMode } (); return true; } @@ -117,7 +117,7 @@ class userOptions { # /** List default options and their value */ - private function LISTER( ) { + private function LISTER() { $def = User::getDefaultOptions(); ksort( $def ); $maxOpt = 0; @@ -130,7 +130,7 @@ class userOptions { } /** List options usage */ - private function USAGER( ) { + private function USAGER() { $ret = array(); $defaultOptions = User::getDefaultOptions(); @@ -181,7 +181,7 @@ class userOptions { /** Change our users options */ - private function CHANGER( ) { + private function CHANGER() { $this->warn(); // We list user by user_id from one of the slave database @@ -212,7 +212,9 @@ class userOptions { if ( !$this->mDry ) { $user->saveSettings(); } - if ( !$this->mQuiet ) { print " OK\n"; } + if ( !$this->mQuiet ) { + print " OK\n"; + } } elseif ( !$this->mQuiet ) { print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n";