* @file
*/
-use IPSet\IPSet;
use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
use MediaWiki\Session\Token;
use MediaWiki\Auth\AuthenticationResponse;
use MediaWiki\Auth\AuthenticationRequest;
use MediaWiki\User\UserIdentity;
+use Wikimedia\IPSet;
use Wikimedia\ScopedCallback;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\DBExpectedError;
'reupload-shared',
'rollback',
'sendemail',
- 'sendemail-new-users',
'siteadmin',
'suppressionlog',
'suppressredirect',
protected $mRegistration;
/** @var int */
protected $mEditCount;
- /**
- * @var array No longer used since 1.29; use User::getGroups() instead
- * @deprecated since 1.29
- */
- private $mGroups;
/** @var UserGroupMembership[] Associative array of (group name => UserGroupMembership object) */
protected $mGroupMemberships;
/** @var array */
break;
case 'name':
// Make sure this thread sees its own changes
- if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {
+ $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
+ if ( $lb->hasOrMadeRecentMasterChanges() ) {
$flags |= self::READ_LATEST;
$this->queryFlagsUsed = $flags;
}
$options = $this->mOptions;
}
- $prefs = Preferences::getPreferences( $this, $context );
+ $preferencesFactory = MediaWikiServices::getInstance()->getPreferencesFactory();
+ $prefs = $preferencesFactory->getFormDescriptor( $this, $context );
$mapping = [];
// Pull out the "special" options, so they don't get converted as
// multiselect or checkmatrix.
- $specialOptions = array_fill_keys( Preferences::getSaveBlacklist(), true );
+ $specialOptions = array_fill_keys( $preferencesFactory->getSaveBlacklist(), true );
foreach ( $specialOptions as $name => $value ) {
unset( $prefs[$name] );
}
$multiselectOptions = [];
foreach ( $prefs as $name => $info ) {
if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
- ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) {
+ ( isset( $info['class'] ) && $info['class'] == HTMLMultiSelectField::class ) ) {
$opts = HTMLFormField::flattenOptions( $info['options'] );
$prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
$checkmatrixOptions = [];
foreach ( $prefs as $name => $info ) {
if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
- ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) {
+ ( isset( $info['class'] ) && $info['class'] == HTMLCheckMatrix::class ) ) {
$columns = HTMLFormField::flattenOptions( $info['columns'] );
$rows = HTMLFormField::flattenOptions( $info['rows'] );
$prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;