*/
function __construct( $opts, $args ) {
if ( !$this->checkOpts( $opts, $args ) ) {
- UserOptions::showUsageAndExit();
+ self::showUsageAndExit();
} else {
$this->mReady = $this->initializeOpts( $opts, $args );
}
* @return bool
*/
private function initializeOpts( $opts, $args ) {
-
$this->mQuick = isset( $opts['nowarn'] );
$this->mQuiet = isset( $opts['quiet'] );
$this->mDry = isset( $opts['dry'] );
/**
* Dumb stuff to run a mode.
+ * @return bool
*/
public function run() {
if ( !$this->mReady ) {
);
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;
);
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}'): ";
* @return bool
*/
public function warn() {
-
if ( $this->mQuick ) {
return true;
}