MediaWiki master
|
Backend class for blocking utils. More...
Public Member Functions | |
__construct (ServiceOptions $options, UserIdentityLookup $userIdentityLookup, UserNameUtils $userNameUtils, $wikiId=Block::LOCAL) | |
parseBlockTarget ( $target) | |
From string specification or UserIdentity, get the block target and the type of target. | |
parseBlockTargetRow ( $row) | |
From a row which must contain bt_auto, bt_user, bt_address and bl_id, and optionally bt_user_text, determine the block target and type. | |
validateTarget ( $value) | |
Validate block target. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Backend class for blocking utils.
This service should contain any methods that are useful to more than one blocking-related class and don't fit any other service.
For now, this includes only
Definition at line 47 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::__construct | ( | ServiceOptions | $options, |
UserIdentityLookup | $userIdentityLookup, | ||
UserNameUtils | $userNameUtils, | ||
$wikiId = Block::LOCAL ) |
Definition at line 62 of file BlockUtils.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Block\BlockUtils::parseBlockTarget | ( | $target | ) |
From string specification or UserIdentity, get the block target and the type of target.
Note that, except for null, it is always safe to treat the target as a string; for UserIdentityValue objects this will return UserIdentityValue::__toString() which in turn gives UserIdentityValue::getName().
If the type is not null, it will be an AbstractBlock::TYPE_ constant.
Since 1.42, it is no longer safe to pass a value from the database field ipb_address/bt_address to this method, since the username is normalized. Use parseBlockTargetRow() instead. (T346683)
string | UserIdentity | null | $target |
Definition at line 93 of file BlockUtils.php.
References MediaWiki\Block\Block\TYPE_IP, and MediaWiki\Block\Block\TYPE_USER.
Referenced by MediaWiki\Block\BlockPermissionChecker\__construct().
MediaWiki\Block\BlockUtils::parseBlockTargetRow | ( | $row | ) |
From a row which must contain bt_auto, bt_user, bt_address and bl_id, and optionally bt_user_text, determine the block target and type.
\\stdClass | $row |
Definition at line 153 of file BlockUtils.php.
References MediaWiki\Block\Block\TYPE_AUTO, MediaWiki\Block\Block\TYPE_IP, MediaWiki\Block\Block\TYPE_RANGE, and MediaWiki\Block\Block\TYPE_USER.
MediaWiki\Block\BlockUtils::validateTarget | ( | $value | ) |
Validate block target.
string | UserIdentity | $value |
Definition at line 185 of file BlockUtils.php.
const MediaWiki\Block\BlockUtils::CONSTRUCTOR_OPTIONS |
Definition at line 58 of file BlockUtils.php.