MediaWiki master
|
A block target for an IP address range. More...
Inherits MediaWiki\Block\BlockTarget, and MediaWiki\Block\BlockTargetWithIp.
Public Member Functions | |
__construct (string $cidr, array $limits, $wikiId=WikiAwareEntity::LOCAL) | |
getHexRangeEnd () | |
Get the end of the range in hexadecimal form. | |
getHexRangeStart () | |
Get the start of the range in hexadecimal form. | |
getLogPage () | |
Get the title to be used when logging an action on this block. | |
getSpecificity () | |
Get the score of this block for purposes of choosing a more specific block, where lower is more specific. | |
getType () | |
Get one of the Block::TYPE_xxx constants associated with this target. | |
toHexRange () | |
Get the range as a hexadecimal tuple. | |
toString () | |
Get the username, the IP address, range, or autoblock ID prefixed with a "#". | |
validateForCreation () | |
Check the target data against more stringent requirements imposed when a block is created from user input. | |
![]() | |
__toString () | |
equals (?BlockTarget $other) | |
Compare this object with another one. | |
getLegacyTuple () | |
Get the target and type tuple conventionally returned by BlockUtils::parseBlockTarget() | |
getWikiId () | |
Get the ID of the wiki this page belongs to. | |
![]() | |
assertWiki ( $wikiId) | |
Throws if $wikiId is different from the return value of getWikiId(). | |
Protected Member Functions | |
getLegacyUnion () | |
Get the first part of the legacy tuple. | |
![]() | |
__construct ( $wikiId) | |
Additional Inherited Members | |
![]() | |
string false | $wikiId |
A block target for an IP address range.
Definition at line 16 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::__construct | ( | string | $cidr, |
array | $limits, | ||
$wikiId = WikiAwareEntity::LOCAL ) |
string | $cidr | The range specification in CIDR notation |
array | $limits | The minimum prefix lengths indexed by protocol (IPv4 or IPv6) |
string | false | $wikiId | The wiki ID |
Definition at line 29 of file RangeBlockTarget.php.
References MediaWiki\Block\BlockTarget\$wikiId.
MediaWiki\Block\RangeBlockTarget::getHexRangeEnd | ( | ) |
Get the end of the range in hexadecimal form.
Definition at line 109 of file RangeBlockTarget.php.
Referenced by MediaWiki\Block\DatabaseBlock\getRangeEnd().
MediaWiki\Block\RangeBlockTarget::getHexRangeStart | ( | ) |
Get the start of the range in hexadecimal form.
Definition at line 100 of file RangeBlockTarget.php.
Referenced by MediaWiki\Block\DatabaseBlock\getRangeStart().
|
protected |
Get the first part of the legacy tuple.
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 113 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::getLogPage | ( | ) |
Get the title to be used when logging an action on this block.
For an autoblock, the title is technically invalid, with a hash character in the DB key. For a range block, the title is valid but is not a user page for a specific user.
See also getUserPage(), which exists only for subclasses which relate to a specific user with a talk page.
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 43 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::getSpecificity | ( | ) |
Get the score of this block for purposes of choosing a more specific block, where lower is more specific.
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 47 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::getType | ( | ) |
Get one of the Block::TYPE_xxx constants associated with this target.
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 39 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::toHexRange | ( | ) |
Get the range as a hexadecimal tuple.
Implements MediaWiki\Block\BlockTargetWithIp.
Definition at line 86 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::toString | ( | ) |
Get the username, the IP address, range, or autoblock ID prefixed with a "#".
Such a string will round-trip through BlockTarget::newFromString(), giving back the same target.
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 35 of file RangeBlockTarget.php.
MediaWiki\Block\RangeBlockTarget::validateForCreation | ( | ) |
Check the target data against more stringent requirements imposed when a block is created from user input.
This is in addition to the loose validation done by BlockTargetFactory::newFromString().
Reimplemented from MediaWiki\Block\BlockTarget.
Definition at line 58 of file RangeBlockTarget.php.