43 private int $migrationStage;
50 parent::__construct(
'Wantedfiles' );
51 $this->repoGroup = $repoGroup;
60 # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what
61 # category would be used on main namespace pages, for those tricky wikipedia
62 # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}.
63 $catMessage = $this->
msg(
'broken-file-category' )
64 ->page( PageReferenceValue::localReference(
NS_MAIN,
"Wanted Files" ) )
65 ->inContentLanguage();
67 if ( !$catMessage->isDisabled() ) {
68 $category = Title::makeTitleSafe(
NS_CATEGORY, $catMessage->text() );
77 $noForeign =
'-noforeign';
82 ->msg(
'wantedfiletext-cat' . $noForeign )
83 ->params( $category->getFullText() )
87 ->msg(
'wantedfiletext-nocat' . $noForeign )
101 return $this->repoGroup->hasForeignRepos();
128 return (
bool)$this->repoGroup->findFile( $title );
133 $fileTable =
'image';
134 $nameField =
'img_name';
139 $nameField =
'file_name';
140 $extraConds1 = [
'img1.file_deleted' => 0 ];
141 $extraConds2 = [
'img2.file_deleted' => 0 ];
148 'img1' => $fileTable,
149 'img2' => $fileTable,
154 'value' =>
'COUNT(*)'
157 'img1.' . $nameField =>
null,
159 'img2.' . $nameField =>
null,
161 'options' => [
'GROUP BY' =>
'il_to' ],
163 'img1' => [
'LEFT JOIN',
164 array_merge( [
'il_to = img1.' . $nameField ], $extraConds1 ),
166 'page' => [
'LEFT JOIN', [
167 'il_to = page_title',
170 'redirect' => [
'LEFT JOIN', [
175 'img2' => [
'LEFT JOIN',
176 array_merge( [
'rd_title = img2.' . $nameField ], $extraConds2 ),
183 return 'maintenance';
191class_alias( SpecialWantedFiles::class,
'WantedFilesPage' );
const SCHEMA_COMPAT_READ_OLD
A class containing constants representing the names of configuration variables.
const FileSchemaMigrationStage
Name constant for the FileSchemaMigrationStage setting, for use with Config::get()
setDatabaseProvider(IConnectionProvider $databaseProvider)
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Base class for a "wanted" query page like WantedPages, WantedTemplates, etc.