This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
43 lines
1.7 KiB
PHP
43 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
use File;
|
|
use MediaWiki\Linker\DummyLinker;
|
|
use MediaWiki\Title\Title;
|
|
use Parser;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "ImageBeforeProduceHTML" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface ImageBeforeProduceHTMLHook {
|
|
/**
|
|
* This hook is called before producing the HTML created by a wiki image insertion.
|
|
* You can skip the default logic entirely by returning false, or just modify a few
|
|
* things using call-by-reference.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param DummyLinker $linker Formerly a Skin/Linker, now a DummyLinker for b/c
|
|
* @param Title &$title Title object of the image
|
|
* @param File|false &$file File object, or false if it doesn't exist
|
|
* @param array &$frameParams Various parameters with special meanings; see documentation in
|
|
* includes/Linker.php for Linker::makeImageLink
|
|
* @param array &$handlerParams Various parameters with special meanings; see documentation in
|
|
* includes/Linker.php for Linker::makeImageLink
|
|
* @param string|bool &$time Timestamp of file in 'YYYYMMDDHHIISS' string
|
|
* form, or false for current
|
|
* @param string &$res Final HTML output, used if you return false
|
|
* @param Parser $parser
|
|
* @param string &$query Query params for desc URL
|
|
* @param string &$widthOption Used by the parser to remember the user preference thumbnailsize
|
|
* @return bool|void True or no return value to continue or false to skip the default logic
|
|
*/
|
|
public function onImageBeforeProduceHTML( $linker, &$title, &$file,
|
|
&$frameParams, &$handlerParams, &$time, &$res, $parser, &$query, &$widthOption
|
|
);
|
|
}
|