Since I8d825eb02c69cc66d90bd41325133fd3f99f0226, modification of the $cond parameter to the ModifyExportDisplayQuery hook has had no effect, since $cond is now incorporated into a condition array $conds. This seems contrary to the purpose of the hook, although no extension in CodeSearch actually depends on it. It was also a documentation error, with the incorrect type on the interface causing a Phan error in the HookRunner call site migration patch. So, add a $conds parameter to the hook, which allows modification of the array, and fix the documentation. Change-Id: Id4608cec35df56456d7dad4de107bbef816e964b
32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
use Wikimedia\Rdbms\IDatabase;
|
|
|
|
/**
|
|
* @stable for implementation
|
|
* @ingroup Hooks
|
|
*/
|
|
interface ModifyExportQueryHook {
|
|
/**
|
|
* Use this hook to modify the query used by the exporter.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param IDatabase $db Database object to be queried
|
|
* @param array &$tables Tables in the query
|
|
* @param string $cond An SQL fragment included in the WHERE clause which is used to filter
|
|
* the results, for example to a specific page. Since 1.31, modification of this
|
|
* parameter has no effect. Since 1.35, you can use $conds instead to modify the
|
|
* array of conditions passed to IDatabase::select().
|
|
* @param array &$opts Options for the query
|
|
* @param array &$join_conds Join conditions for the query
|
|
* @param array &$conds The array of conditions to be passed to IDatabase::select(). Can be
|
|
* modified. Includes the value of $cond.
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onModifyExportQuery( $db, &$tables, $cond, &$opts,
|
|
&$join_conds, &$conds
|
|
);
|
|
}
|