* In queryLinks(), use the full result cache even if a limit is specified. Truncate the result in the caller if necessary. * Remove the confusing boolean parameter from partitionResult(). Make it always false and fix up the results afterwards. So the batches are always the inclusive start and end IDs, false is never returned. * Inject a logger instead of using wfDebug() * Use private not protected. Defaulting to protected was just a coding style quirk I had at the time. * In queryLinks(), use early return. * In hooks BacklinkCacheGetConditionsHook and BacklinkCacheGetPrefixHook adjust the parameter type hint to avoid the need for a Phan override. Change-Id: Ia53f494633affe48316f0a8b63d03596239ad53c
26 lines
748 B
PHP
26 lines
748 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Cache\Hook;
|
|
|
|
use MediaWiki\Title\Title;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "BacklinkCacheGetConditions" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface BacklinkCacheGetConditionsHook {
|
|
/**
|
|
* Use this hook to set conditions for query when links to certain title are fetched.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param string $table Table name
|
|
* @param Title $title Title of the page to which backlinks are sought
|
|
* @param array|null &$conds Query conditions
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onBacklinkCacheGetConditions( $table, $title, &$conds );
|
|
}
|