MediaWiki  master
MediaWiki\BadFileLookup Class Reference
Collaboration diagram for MediaWiki\BadFileLookup:

Public Member Functions

 __construct (callable $listCallback, BagOStuff $cache, RepoGroup $repoGroup, TitleParser $titleParser, HookContainer $hookContainer)
 Do not call directly. More...
 isBadFile ( $name, LinkTarget $contextTitle=null)
 Determine if a file exists on the 'bad image list'. More...

Private Attributes

array null $badFiles
 Parsed bad file list. More...
BagOStuff $cache
 Cache of parsed bad image list. More...
HookRunner $hookRunner
callable $listCallback
 Returns contents of bad file list (see comment for isBadFile()) More...
RepoGroup $repoGroup
TitleParser $titleParser

Detailed Description

Definition at line 13 of file BadFileLookup.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\BadFileLookup::__construct ( callable  $listCallback,
BagOStuff  $cache,
RepoGroup  $repoGroup,
TitleParser  $titleParser,
HookContainer  $hookContainer 

Do not call directly.

Use MediaWikiServices.

callable$listCallbackCallback that returns wikitext of a bad file list
BagOStuff$cacheFor caching parsed versions of the bad file list

Definition at line 41 of file BadFileLookup.php.

References $cache.

Member Function Documentation

◆ isBadFile()

MediaWiki\BadFileLookup::isBadFile (   $name,
LinkTarget  $contextTitle = null 

Determine if a file exists on the 'bad image list'.

The format of MediaWiki:Bad_image_list is as follows:

  • Only list items (lines starting with "*") are considered
  • The first link on a line must be a link to a bad file
  • Any subsequent links on the same line are considered to be exceptions, i.e. articles where the file may occur inline.
string$nameThe file name to check
LinkTarget | null$contextTitleThe page on which the file occurs, if known

Definition at line 68 of file BadFileLookup.php.

References $file, $line, $lines, and $title.

Member Data Documentation

◆ $badFiles

array null MediaWiki\BadFileLookup::$badFiles

Parsed bad file list.

Definition at line 27 of file BadFileLookup.php.

◆ $cache

BagOStuff MediaWiki\BadFileLookup::$cache

Cache of parsed bad image list.

Definition at line 18 of file BadFileLookup.php.

◆ $hookRunner

HookRunner MediaWiki\BadFileLookup::$hookRunner

Definition at line 30 of file BadFileLookup.php.

◆ $listCallback

callable MediaWiki\BadFileLookup::$listCallback

Returns contents of bad file list (see comment for isBadFile())

Definition at line 15 of file BadFileLookup.php.

◆ $repoGroup

RepoGroup MediaWiki\BadFileLookup::$repoGroup

Definition at line 21 of file BadFileLookup.php.

◆ $titleParser

TitleParser MediaWiki\BadFileLookup::$titleParser

Definition at line 24 of file BadFileLookup.php.

The documentation for this class was generated from the following file: