When they're not used outside of the scope where they're defined.
Change-Id: I5ca1de8420c1180bf7f5d9f28f2a7402a256adf8
- * @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 ) {
* @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 {
if ( $repo ) {
$this->repo = $repo;
} else {
wfDebug( __METHOD__ . " creating new UploadStash instance with no user\n" );
}
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() {
}
public function execute() {
- $this->nullsOnly = $this->getOption( 'nulls' );
+ $nullsOnly = $this->getOption( 'nulls' );
if ( !$this->getOption( 'nowarn' ) ) {
if ( !$this->getOption( 'nowarn' ) ) {
- if ( $this->nullsOnly ) {
$this->output( "The script is about to reset the user_token "
. "for USERS WITH NULL TOKENS in the database.\n" );
} else {
$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 = [];
$dbr = $this->getDB( DB_REPLICA );
$where = [];
- if ( $this->nullsOnly ) {
// Have to build this by hand, because \ is escaped in helper functions
$where = [ 'user_token = \'' . str_repeat( '\0', 32 ) . '\'' ];
}
// Have to build this by hand, because \ is escaped in helper functions
$where = [ 'user_token = \'' . str_repeat( '\0', 32 ) . '\'' ];
}