wiki.techinc.nl/includes/block
Thalia a387a375a1 Decouple DatabaseBlock::newFromTarget from DatabaseBlock::newLoad
Before this, DatabaseBlock:newFromTarget initialises a new block and
calls DatabaseBlock::newLoad on that instance, passing through the
target and type via that instance. However, newLoad returns a brand
new block instance. This patch makes newLoad into a static method,
with the target and type passed as method parameters.

It also separates the block-choosing logic in newLoad into a separate
method, DatabaseBlock::chooseMostSpecificBlock. Doing this (1) makes
it more transparent that Block uses two different ways to choose a
block (see also Block::chooseBlock), and (2) makes it possible to
re-use newLoad to get multiple blocks.

Also, filter out any duplicate autoblocks that are found by newLoad.

Bug: T206163
Change-Id: Iefa3aaadf2954c3b86f5c691096af31de40fae6c
2019-06-05 11:38:29 -04:00
..
Restriction Rename Block to MediaWiki\Block\DatabaseBlock 2019-05-28 12:20:48 +01:00
AbstractBlock.php Rename Block to MediaWiki\Block\DatabaseBlock 2019-05-28 12:20:48 +01:00
BlockManager.php Rename Block to MediaWiki\Block\DatabaseBlock 2019-05-28 12:20:48 +01:00
BlockRestrictionStore.php Rename Block to MediaWiki\Block\DatabaseBlock 2019-05-28 12:20:48 +01:00
DatabaseBlock.php Decouple DatabaseBlock::newFromTarget from DatabaseBlock::newLoad 2019-06-05 11:38:29 -04:00
SystemBlock.php Separate Block into AbstractBlock, Block and SystemBlock 2019-05-07 17:36:31 -05:00