32 private $searchEngineFactory;
40 parent::__construct(
'Filepath' );
41 $this->mAllowedRedirectParams = [
'width',
'height' ];
42 $this->searchEngineFactory = $searchEngineFactory;
58 if ( $redirect ===
null ) {
61 $this->mAddedRedirectParams[
'wpvalue'] =
$file;
82 $searchEngine = $this->searchEngineFactory->create();
83 $searchEngine->setLimitOffset( $limit, $offset );
85 $searchEngine->setNamespaces( [
NS_FILE ] );
86 $result = $searchEngine->defaultPrefixSearch( $search );
88 return array_map(
static function (
Title $t ) {
Shortcut to construct a special page alias.
Factory class for SearchEngine.
A special page that redirects to the URL of a given file.
__construct(SearchEngineFactory $searchEngineFactory)
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getRedirect( $par)
Implement by redirecting through Special:Redirect/file.
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
getRequest()
Get the WebRequest being used for this instance.
Represents a title within MediaWiki.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.