MediaWiki REL1_37
|
Public Member Functions | |
__construct (ServiceOptions $options, LoggerInterface $logger, ActorStoreFactory $actorStoreFactory, BlockRestrictionStore $blockRestrictionStore, CommentStore $commentStore, HookContainer $hookContainer, ILoadBalancer $loadBalancer, ReadOnlyMode $readOnlyMode, UserFactory $userFactory) | |
deleteBlock (DatabaseBlock $block) | |
Delete a DatabaseBlock from the database. | |
insertBlock (DatabaseBlock $block, IDatabase $database=null) | |
Insert a block into the block table. | |
purgeExpiredBlocks () | |
Delete expired blocks from the ipblocks table. | |
updateBlock (DatabaseBlock $block) | |
Update a block in the DB with new parameters. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Member Functions | |
checkDatabaseDomain (?IDatabase $db, $expectedWiki) | |
Throws an exception if the given database connection does not match the given wiki ID. | |
doRetroactiveAutoblock (DatabaseBlock $block) | |
Handles retroactively autoblocking the last IP used by the user (if it is a user) blocked by an auto block. | |
getArrayForAutoblockUpdate (DatabaseBlock $block) | |
Get an array suitable for autoblock updates. | |
getArrayForDatabaseBlock (DatabaseBlock $block, IDatabase $dbw) | |
Get an array suitable for passing to $dbw->insert() or $dbw->update() | |
performRetroactiveAutoblock (DatabaseBlock $block) | |
Actually retroactively autoblocks the last IP used by the user (if it is a user) blocked by this block. | |
Definition at line 47 of file DatabaseBlockStore.php.
MediaWiki\Block\DatabaseBlockStore::__construct | ( | ServiceOptions | $options, |
LoggerInterface | $logger, | ||
ActorStoreFactory | $actorStoreFactory, | ||
BlockRestrictionStore | $blockRestrictionStore, | ||
CommentStore | $commentStore, | ||
HookContainer | $hookContainer, | ||
ILoadBalancer | $loadBalancer, | ||
ReadOnlyMode | $readOnlyMode, | ||
UserFactory | $userFactory | ||
) |
ServiceOptions | $options | |
LoggerInterface | $logger | |
ActorStoreFactory | $actorStoreFactory | |
BlockRestrictionStore | $blockRestrictionStore | |
CommentStore | $commentStore | |
HookContainer | $hookContainer | |
ILoadBalancer | $loadBalancer | |
ReadOnlyMode | $readOnlyMode | |
UserFactory | $userFactory |
Definition at line 95 of file DatabaseBlockStore.php.
References MediaWiki\Block\DatabaseBlockStore\$actorStoreFactory, MediaWiki\Block\DatabaseBlockStore\$blockRestrictionStore, MediaWiki\Block\DatabaseBlockStore\$commentStore, MediaWiki\Block\DatabaseBlockStore\$loadBalancer, MediaWiki\Block\DatabaseBlockStore\$logger, MediaWiki\Block\DatabaseBlockStore\$options, MediaWiki\Block\DatabaseBlockStore\$readOnlyMode, MediaWiki\Block\DatabaseBlockStore\$userFactory, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
|
private |
Throws an exception if the given database connection does not match the given wiki ID.
?IDatabase | $db | |
string | false | $expectedWiki |
Definition at line 157 of file DatabaseBlockStore.php.
References Wikimedia\Rdbms\IDatabase\getDomainID().
Referenced by MediaWiki\Block\DatabaseBlockStore\insertBlock().
MediaWiki\Block\DatabaseBlockStore::deleteBlock | ( | DatabaseBlock | $block | ) |
Delete a DatabaseBlock from the database.
DatabaseBlock | $block |
MWException |
Definition at line 345 of file DatabaseBlockStore.php.
|
private |
Handles retroactively autoblocking the last IP used by the user (if it is a user) blocked by an auto block.
DatabaseBlock | $block |
Definition at line 470 of file DatabaseBlockStore.php.
References MediaWiki\Block\AbstractBlock\getTargetName().
Referenced by MediaWiki\Block\DatabaseBlockStore\insertBlock(), and MediaWiki\Block\DatabaseBlockStore\updateBlock().
|
private |
Get an array suitable for autoblock updates.
DatabaseBlock | $block |
Definition at line 437 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\updateBlock().
|
private |
Get an array suitable for passing to $dbw->insert() or $dbw->update()
DatabaseBlock | $block | |
IDatabase | $dbw | Database to use if not the same as the one in the load balancer. Must connect to the wiki identified by $block->getBlocker->getWikiId(). |
Definition at line 384 of file DatabaseBlockStore.php.
References MediaWiki\Block\AbstractBlock\getTargetUserIdentity().
Referenced by MediaWiki\Block\DatabaseBlockStore\insertBlock(), and MediaWiki\Block\DatabaseBlockStore\updateBlock().
MediaWiki\Block\DatabaseBlockStore::insertBlock | ( | DatabaseBlock | $block, |
IDatabase | $database = null |
||
) |
Insert a block into the block table.
Will fail if there is a conflicting block (same name and options) already in the database.
DatabaseBlock | $block | |
IDatabase | null | $database | Database to use if not the same as the one in the load balancer. Must connect to the wiki identified by $block->getBlocker->getWikiId(). |
MWException |
Definition at line 186 of file DatabaseBlockStore.php.
References MediaWiki\Block\DatabaseBlockStore\checkDatabaseDomain(), DB_PRIMARY, MediaWiki\Block\DatabaseBlockStore\doRetroactiveAutoblock(), MediaWiki\Block\DatabaseBlockStore\getArrayForDatabaseBlock(), MediaWiki\Block\DatabaseBlock\getBlocker(), MediaWiki\Block\DatabaseBlock\getId(), MediaWiki\Block\DatabaseBlock\getRawRestrictions(), MediaWiki\Block\AbstractBlock\getTargetUserIdentity(), MediaWiki\Block\AbstractBlock\getTimestamp(), MediaWiki\Block\DatabaseBlockStore\purgeExpiredBlocks(), and MediaWiki\Block\DatabaseBlock\setId().
|
private |
Actually retroactively autoblocks the last IP used by the user (if it is a user) blocked by this block.
This will use the recentchanges table.
DatabaseBlock | $block |
Definition at line 501 of file DatabaseBlockStore.php.
MediaWiki\Block\DatabaseBlockStore::purgeExpiredBlocks | ( | ) |
Delete expired blocks from the ipblocks table.
Definition at line 124 of file DatabaseBlockStore.php.
References MediaWiki\Block\DatabaseBlockStore\$blockRestrictionStore, Wikimedia\Rdbms\IDatabase\addQuotes(), DB_PRIMARY, Wikimedia\Rdbms\IDatabase\delete(), MediaWiki\Block\BlockRestrictionStore\deleteByBlockId(), Wikimedia\Rdbms\IDatabase\selectFieldValues(), and Wikimedia\Rdbms\IDatabase\timestamp().
Referenced by MediaWiki\Block\DatabaseBlockStore\insertBlock().
MediaWiki\Block\DatabaseBlockStore::updateBlock | ( | DatabaseBlock | $block | ) |
Update a block in the DB with new parameters.
The ID field needs to be loaded first.
DatabaseBlock | $block |
Definition at line 268 of file DatabaseBlockStore.php.
References $success, DB_PRIMARY, MediaWiki\Block\DatabaseBlockStore\doRetroactiveAutoblock(), MediaWiki\Block\DatabaseBlockStore\getArrayForAutoblockUpdate(), MediaWiki\Block\DatabaseBlockStore\getArrayForDatabaseBlock(), MediaWiki\Block\DatabaseBlock\getBlocker(), MediaWiki\Block\DatabaseBlock\getId(), MediaWiki\Block\DatabaseBlock\getRawRestrictions(), MediaWiki\Block\AbstractBlock\getTimestamp(), and MediaWiki\Block\DatabaseBlock\isAutoblocking().
|
private |
Definition at line 64 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 67 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct(), and MediaWiki\Block\DatabaseBlockStore\purgeExpiredBlocks().
|
private |
Definition at line 70 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 73 of file DatabaseBlockStore.php.
|
private |
Definition at line 76 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 61 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 50 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 79 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
|
private |
Definition at line 82 of file DatabaseBlockStore.php.
Referenced by MediaWiki\Block\DatabaseBlockStore\__construct().
const MediaWiki\Block\DatabaseBlockStore::CONSTRUCTOR_OPTIONS |
Definition at line 55 of file DatabaseBlockStore.php.