26 private readonly
int $fileMigrationStage;
33 parent::__construct(
'Wantedfiles' );
41 # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what
42 # category would be used on main namespace pages, for those tricky wikipedia
43 # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}.
44 $catMessage = $this->
msg(
'broken-file-category' )
45 ->page( PageReferenceValue::localReference(
NS_MAIN,
"Wanted Files" ) )
46 ->inContentLanguage();
48 if ( !$catMessage->isDisabled() ) {
49 $category = Title::makeTitleSafe(
NS_CATEGORY, $catMessage->text() );
58 $noForeign =
'-noforeign';
63 ->msg(
'wantedfiletext-cat' . $noForeign, $category->getFullText() )
67 ->msg(
'wantedfiletext-nocat' . $noForeign )
81 return $this->repoGroup->hasForeignRepos();
108 return (
bool)$this->repoGroup->findFile( $title );
114 $fileTable =
'image';
115 $nameField =
'img_name';
120 $nameField =
'file_name';
121 $extraConds1 = [
'img1.file_deleted' => 0 ];
122 $extraConds2 = [
'img2.file_deleted' => 0 ];
131 'img1' => $fileTable,
132 'img2' => $fileTable,
136 'title' =>
'lt_title',
137 'value' =>
'COUNT(*)'
140 'img1.' . $nameField =>
null,
142 'img2.' . $nameField =>
null,
144 'options' => [
'GROUP BY' =>
'lt_title' ],
146 'linktarget' => [
'JOIN', [
'il_target_id = lt_id' ] ],
147 'img1' => [
'LEFT JOIN',
148 array_merge( [
'lt_title = img1.' . $nameField,
'lt_namespace' =>
NS_FILE ], $extraConds1 ),
150 'page' => [
'LEFT JOIN', [
151 'lt_title = page_title',
154 'redirect' => [
'LEFT JOIN', [
159 'img2' => [
'LEFT JOIN',
160 array_merge( [
'rd_title = img2.' . $nameField ], $extraConds2 ),
168 return 'maintenance';
176class_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()
Factory for LinkBatch objects to batch query page metadata.
setDatabaseProvider(IConnectionProvider $databaseProvider)
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
getConfig()
Shortcut to get main config object.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Base class for a "wanted" query page like WantedPages, WantedTemplates, etc.