* 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
23 lines
588 B
PHP
23 lines
588 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Cache\Hook;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "BacklinkCacheGetPrefix" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface BacklinkCacheGetPrefixHook {
|
|
/**
|
|
* Use this hook to set a prefix for a specific link table.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param string $table Table name
|
|
* @param string|null &$prefix
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onBacklinkCacheGetPrefix( $table, &$prefix );
|
|
}
|