2declare( strict_types=1 );
6use CallbackFilterIterator;
26 $this->tempUserConfig = $tempUserConfig;
27 $this->userRegistrationLookup = $userRegistrationLookup;
40 $userName = $user->getName();
42 !$this->tempUserConfig->isTempName( $userName ) ||
48 if ( !$this->expiryCache->has( $userName ) ) {
49 $registration = $this->userRegistrationLookup->getFirstRegistration( $user );
54 return $this->expiryCache->get( $userName );
65 foreach ( $users as $user ) {
66 $usersById[$user->getId()] = $user->getName();
69 $users = is_array( $users ) ?
new ArrayIterator( $users ) : new IteratorIterator( $users );
70 $timestampsById = $this->userRegistrationLookup->getFirstRegistrationBatch(
71 new CallbackFilterIterator(
74 $user->isRegistered() && $this->tempUserConfig->isTempName( $user->getName() )
78 foreach ( $timestampsById as $userId => $registrationTimestamp ) {
80 $this->expiryCache->set(
82 $this->getExpirationState( $registrationTimestamp )
94 if ( !is_string( $registration ) ) {
98 $expireAfterDays = $this->tempUserConfig->getExpireAfterDays();
99 $expiresAt = (int)
wfTimestamp( TS_UNIX, $registration ) + $expireAfterDays * 86400;
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
if(!defined('MW_SETUP_CALLBACK'))