summaryrefslogtreecommitdiff
path: root/maintenance/userOptions.inc
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/userOptions.inc')
-rw-r--r--maintenance/userOptions.inc36
1 files changed, 19 insertions, 17 deletions
diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc
index 2a066579..51da80d3 100644
--- a/maintenance/userOptions.inc
+++ b/maintenance/userOptions.inc
@@ -25,7 +25,7 @@
$options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' );
$optionsWithArgs = array( 'old', 'new' );
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
/**
* @ingroup Maintenance
@@ -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";