dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix issues identified by SpaceBeforeSingleLineComment sniff
[lhc/web/wiklou.git]
/
maintenance
/
userOptions.inc
diff --git
a/maintenance/userOptions.inc
b/maintenance/userOptions.inc
index
5998cb5
..
99ba3b8
100644
(file)
--- a/
maintenance/userOptions.inc
+++ b/
maintenance/userOptions.inc
@@
-40,7
+40,11
@@
class UserOptions {
private $mMode, $mReady;
private $mMode, $mReady;
- /** Constructor. Will show usage and exit if script options are not correct */
+ /**
+ * Constructor. Will show usage and exit if script options are not correct
+ * @param array $opts
+ * @param array $args
+ */
function __construct( $opts, $args ) {
if ( !$this->checkOpts( $opts, $args ) ) {
UserOptions::showUsageAndExit();
function __construct( $opts, $args ) {
if ( !$this->checkOpts( $opts, $args ) ) {
UserOptions::showUsageAndExit();
@@
-107,7
+111,8
@@
class UserOptions {
return false;
}
return false;
}
- $this->{ $this->mMode } ();
+ $this->{$this->mMode}();
+
return true;
}
return true;
}
@@
-139,7
+144,7
@@
class UserOptions {
array( 'user_id' ),
array(),
__METHOD__
array( 'user_id' ),
array(),
__METHOD__
-
);
+ );
foreach ( $result as $id ) {
foreach ( $result as $id ) {
@@
-159,7
+164,6
@@
class UserOptions {
@$ret[$this->mAnOption][$userValue]++;
// @codingStandardsIgnoreEnd
}
@$ret[$this->mAnOption][$userValue]++;
// @codingStandardsIgnoreEnd
}
-
} else {
foreach ( $defaultOptions as $name => $defaultValue ) {
} else {
foreach ( $defaultOptions as $name => $defaultValue ) {
@@
-192,7
+196,7
@@
class UserOptions {
array( 'user_id' ),
array(),
__METHOD__
array( 'user_id' ),
array(),
__METHOD__
-
);
+ );
foreach ( $result as $id ) {
foreach ( $result as $id ) {
@@
-218,7
+222,6
@@
class UserOptions {
if ( !$this->mQuiet ) {
print " OK\n";
}
if ( !$this->mQuiet ) {
print " OK\n";
}
-
} elseif ( !$this->mQuiet ) {
print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n";
}
} elseif ( !$this->mQuiet ) {
print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n";
}
@@
-235,6
+238,7
@@
class UserOptions {
foreach ( $def as $optname => $defaultValue ) {
array_push( $ret, $optname );
}
foreach ( $def as $optname => $defaultValue ) {
array_push( $ret, $optname );
}
+
return $ret;
}
return $ret;
}
@@
-243,7
+247,7
@@
class UserOptions {
#
public static function showUsageAndExit() {
#
public static function showUsageAndExit() {
-print <<<USAGE
+
print <<<USAGE
This script pass through all users and change one of their options.
The new option is NOT validated.
This script pass through all users and change one of their options.
The new option is NOT validated.
@@
-267,7
+271,7
@@
Options:
--dry : do not save user settings back to database
USAGE;
--dry : do not save user settings back to database
USAGE;
- exit( 0 );
+
exit( 0 );
}
/**
}
/**
@@
-280,14
+284,14
@@
USAGE;
return true;
}
return true;
}
-print <<<WARN
+
print <<<WARN
The script is about to change the skin for ALL USERS in the database.
Users with option <$this->mAnOption> = '$this->mOldValue' will be made to use '$this->mNewValue'.
Abort with control-c in the next five seconds....
WARN;
wfCountDown( 5 );
The script is about to change the skin for ALL USERS in the database.
Users with option <$this->mAnOption> = '$this->mOldValue' will be made to use '$this->mNewValue'.
Abort with control-c in the next five seconds....
WARN;
wfCountDown( 5 );
+
return true;
}
return true;
}
-
}
}