MediaWiki REL1_40
MediaWiki\Block\DatabaseBlockStore Class Reference

Public Member Functions

 __construct (ServiceOptions $options, LoggerInterface $logger, ActorStoreFactory $actorStoreFactory, BlockRestrictionStore $blockRestrictionStore, CommentStore $commentStore, HookContainer $hookContainer, ILoadBalancer $loadBalancer, ReadOnlyMode $readOnlyMode, UserFactory $userFactory, $wikiId=DatabaseBlock::LOCAL)
 
 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
 

Detailed Description

Since
1.36
Author
DannyS712

Definition at line 46 of file DatabaseBlockStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Block\DatabaseBlockStore::__construct ( ServiceOptions $options,
LoggerInterface $logger,
ActorStoreFactory $actorStoreFactory,
BlockRestrictionStore $blockRestrictionStore,
CommentStore $commentStore,
HookContainer $hookContainer,
ILoadBalancer $loadBalancer,
ReadOnlyMode $readOnlyMode,
UserFactory $userFactory,
$wikiId = DatabaseBlock::LOCAL )
Parameters
ServiceOptions$options
LoggerInterface$logger
ActorStoreFactory$actorStoreFactory
BlockRestrictionStore$blockRestrictionStore
CommentStore$commentStore
HookContainer$hookContainer
ILoadBalancer$loadBalancer
ReadOnlyMode$readOnlyMode
UserFactory$userFactory
string | false$wikiId

Definition at line 98 of file DatabaseBlockStore.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ deleteBlock()

MediaWiki\Block\DatabaseBlockStore::deleteBlock ( DatabaseBlock $block)

Delete a DatabaseBlock from the database.

Parameters
DatabaseBlock$block
Returns
bool whether it was deleted
Exceptions
MWException

Definition at line 360 of file DatabaseBlockStore.php.

◆ insertBlock()

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.

Parameters
DatabaseBlock$block
IDatabase | null$databaseDatabase to use if not the same as the one in the load balancer. Must connect to the wiki identified by $block->getBlocker->getWikiId().
Returns
bool|array False on failure, assoc array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs)
Exceptions
MWException

Definition at line 195 of file DatabaseBlockStore.php.

References MediaWiki\MainConfigNames\BlockDisablesLogin, DB_PRIMARY, MediaWiki\Block\DatabaseBlock\getBlocker(), MediaWiki\Block\DatabaseBlock\getId(), MediaWiki\Block\DatabaseBlock\getRawRestrictions(), MediaWiki\Block\AbstractBlock\getTargetUserIdentity(), MediaWiki\Block\AbstractBlock\getTimestamp(), MediaWiki\Block\AbstractBlock\getWikiId(), MediaWiki\Block\DatabaseBlockStore\purgeExpiredBlocks(), and MediaWiki\Block\DatabaseBlock\setId().

◆ purgeExpiredBlocks()

MediaWiki\Block\DatabaseBlockStore::purgeExpiredBlocks ( )

◆ updateBlock()

MediaWiki\Block\DatabaseBlockStore::updateBlock ( DatabaseBlock $block)

Update a block in the DB with new parameters.

The ID field needs to be loaded first.

Parameters
DatabaseBlock$block
Returns
bool|array False on failure, array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs)

Definition at line 280 of file DatabaseBlockStore.php.

References $success, DB_PRIMARY, MediaWiki\Block\DatabaseBlock\getId(), MediaWiki\Block\DatabaseBlock\getRawRestrictions(), MediaWiki\Block\AbstractBlock\getTimestamp(), MediaWiki\Block\AbstractBlock\getWikiId(), and MediaWiki\Block\DatabaseBlock\isAutoblocking().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Block\DatabaseBlockStore::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const UpdateRowsPerQuery
Name constant for the UpdateRowsPerQuery setting, for use with Config::get()
const BlockDisablesLogin
Name constant for the BlockDisablesLogin setting, for use with Config::get()
const PutIPinRC
Name constant for the PutIPinRC setting, for use with Config::get()
Access: internal
For use by ServiceWiring

Definition at line 56 of file DatabaseBlockStore.php.


The documentation for this class was generated from the following file: