This extracts the MediaWikiEntryPoint base class and ActionEntryPoint class from the MediaWiki class. MediaWiki itself be deprecated. The intent is to create other subclasses of MediaWikiEntryPoint for the use by other entry points such as thumb.php or api.php. This will allow us to share code between entry points, and make these entry points testable by moving their implementation into a class. Bug: T354216 Change-Id: Ib70e4e67e4cb1b65ac218c095864fb6eb43d0929
41 lines
1 KiB
PHP
41 lines
1 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
use MediaWiki\Actions\ActionEntryPoint;
|
|
use MediaWiki\Output\OutputPage;
|
|
use MediaWiki\Request\WebRequest;
|
|
use MediaWiki\Title\Title;
|
|
use MediaWiki\User\User;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "BeforeInitialize" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface BeforeInitializeHook {
|
|
/**
|
|
* This hook is called before anything is initialized in ActionEntryPoint::performRequest().
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param Title $title Title being used for request
|
|
* @param null $unused
|
|
* @param OutputPage $output
|
|
* @param User $user
|
|
* @param WebRequest $request
|
|
* @param ActionEntryPoint $mediaWikiEntryPoint (changed from MediaWiki
|
|
* to MediaWikiEntryPoint in MW 1.42)
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onBeforeInitialize(
|
|
$title,
|
|
$unused,
|
|
$output,
|
|
$user,
|
|
$request,
|
|
$mediaWikiEntryPoint
|
|
);
|
|
}
|