private $repo;
/**
- * @param User|bool $user Default: false
+ * @param User|bool $user Default: false Sometimes this won't exist, as when running from cron.
* @param UploadStash|bool $stash Default: false
* @param FileRepo|bool $repo Default: false
*/
public function __construct( $user = false, $stash = false, $repo = false ) {
- // user object. sometimes this won't exist, as when running from cron.
- $this->user = $user;
-
if ( $repo ) {
$this->repo = $repo;
} else {
wfDebug( __METHOD__ . " creating new UploadStash instance with no user\n" );
}
- $this->stash = new UploadStash( $this->repo, $this->user );
+ $this->stash = new UploadStash( $this->repo, $user );
}
}
}
public function execute() {
- $this->nullsOnly = $this->getOption( 'nulls' );
+ $nullsOnly = $this->getOption( 'nulls' );
if ( !$this->getOption( 'nowarn' ) ) {
- if ( $this->nullsOnly ) {
+ if ( $nullsOnly ) {
$this->output( "The script is about to reset the user_token "
. "for USERS WITH NULL TOKENS in the database.\n" );
} else {
$dbr = $this->getDB( DB_REPLICA );
$where = [];
- if ( $this->nullsOnly ) {
+ if ( $nullsOnly ) {
// Have to build this by hand, because \ is escaped in helper functions
$where = [ 'user_token = \'' . str_repeat( '\0', 32 ) . '\'' ];
}