MediaWiki REL1_37
|
Backend class for blocking utils. More...
Public Member Functions | |
__construct (ServiceOptions $options, UserIdentityLookup $userIdentityLookup, UserNameUtils $userNameUtils) | |
parseBlockTarget ( $target) | |
From an existing block, get the target and the type of target. | |
validateTarget ( $value) | |
Validate block target. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Member Functions | |
validateIPv4Range (int $range) | |
Validate an IPv4 range. | |
validateIPv6Range (int $range) | |
Validate an IPv6 range. | |
Private Attributes | |
ServiceOptions | $options |
UserIdentityLookup | $userIdentityLookup |
UserNameUtils | $userNameUtils |
Backend class for blocking utils.
This service should contain any methods that are useful to more than one blocking-related class and doesn't fit any other service.
For now, this includes only
Definition at line 45 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::__construct | ( | ServiceOptions | $options, |
UserIdentityLookup | $userIdentityLookup, | ||
UserNameUtils | $userNameUtils | ||
) |
ServiceOptions | $options | |
UserIdentityLookup | $userIdentityLookup | |
UserNameUtils | $userNameUtils |
Definition at line 67 of file BlockUtils.php.
References MediaWiki\Block\BlockUtils\$options, MediaWiki\Block\BlockUtils\$userIdentityLookup, MediaWiki\Block\BlockUtils\$userNameUtils, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Block\BlockUtils::parseBlockTarget | ( | $target | ) |
From an existing block, get the 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.
string | UserIdentity | null | $target |
Definition at line 91 of file BlockUtils.php.
References MediaWiki\Block\Block\TYPE_IP, and MediaWiki\Block\Block\TYPE_USER.
Referenced by MediaWiki\Block\BlockPermissionChecker\__construct(), and SpecialBlock\processFormInternal().
|
private |
Validate an IPv4 range.
int | $range |
Definition at line 202 of file BlockUtils.php.
References StatusValue\fatal().
|
private |
Validate an IPv6 range.
int | $range |
Definition at line 226 of file BlockUtils.php.
References StatusValue\fatal().
MediaWiki\Block\BlockUtils::validateTarget | ( | $value | ) |
Validate block target.
string | UserIdentity | $value |
Definition at line 155 of file BlockUtils.php.
|
private |
Definition at line 47 of file BlockUtils.php.
Referenced by MediaWiki\Block\BlockUtils\__construct().
|
private |
Definition at line 50 of file BlockUtils.php.
Referenced by MediaWiki\Block\BlockUtils\__construct().
|
private |
Definition at line 53 of file BlockUtils.php.
Referenced by MediaWiki\Block\BlockUtils\__construct().
const MediaWiki\Block\BlockUtils::CONSTRUCTOR_OPTIONS |
Definition at line 58 of file BlockUtils.php.