38 private $searchEngineFactory;
55 parent::__construct( $name );
58 if ( !$searchEngineFactory ) {
60 wfDeprecated( __METHOD__ .
' without providing SearchEngineFactory',
'1.39' );
61 $searchEngineFactory = MediaWikiServices::getInstance()->getSearchEngineFactory();
63 $this->searchEngineFactory = $searchEngineFactory;
70 if ( $subpage ===
null || $subpage ===
'' ) {
73 $this->mAddedRedirectParams[
'title'] = $subpage;
87 private function showForm() {
96 'label-message' =>
'special' . $this->msgPrefix .
'-page',
100 $form->setSubmitTextMsg(
'special' . $this->msgPrefix .
'-submit' );
101 $form->setSubmitCallback( [ $this,
'onFormSubmit' ] );
113 $title = $formData[
'page'];
115 $page = Title::newFromTextThrow(
$title );
120 $url = $page->getFullUrlForRedirect( $query );
141 return $this->
prefixSearchString( $search, $limit, $offset, $this->searchEngineFactory );
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Shortcut to construct a special page alias.
Factory class for SearchEngine.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
prefixSearchString( $search, $limit, $offset, SearchEngineFactory $searchEngineFactory=null)
Perform a regular substring search for prefixSearchSubpages.
__construct( $name, $action, $msgPrefix, SearchEngineFactory $searchEngineFactory=null)
getRedirect( $subpage)
If the special page is a redirect, then get the Title object it redirects to.False otherwise....
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
static newFatal( $message,... $parameters)
Factory function for fatal errors.