Page MenuHomePhabricator
Paste P5740

Find disjunctions between wgContentNamespaces and wgNamespacesToBeSearchedDefault
ActivePublic

Authored by TheDJ on Jul 12 2017, 8:14 PM.
<?php
const NS_HELP = 12;
const NS_MAIN = 0;
$wgContentNamespaces = [
'default' => [ NS_MAIN ],
'+arwikisource' => [ 102 ],
'+aswikisource' => [ 102 ], // T45129, T72464
'+bgwikisource' => [ 100 ],
'+bnwikisource' => [ 100 ],
'+brwikisource' => [ 104 ],
'+cawikisource' => [ 106 ],
'+cswikiquote' => [ 100 ],
'+cswikisource' => [ 100 ],
'+dawikisource' => [ 102 ],
'+dewikiversity' => [ 106 ], // T93071
'+enwikibooks' => [ 102, 110 ],
'+enwikisource' => [ 102, 114 ], // T52007
'+eswiki' => [ 104 ], // T41866
'+etwikisource' => [ 106 ],
'+fawikibooks' => [ 102, 110 ], // T76663
'+fawikisource' => [ 102 ],
'+frrwiki' => [ 106 ], // T40023
'+frwikisource' => [ 102 ],
'+frwikiversity' => [ 104 ], // T125948
'+frwiktionary' => [ 106 ], // T97228
'+hewikisource' => [ 100, 106, 108, 110 ], // T98709
'+hrwiki' => [ 102 ], // T42732
'+hrwikisource' => [ 100 ],
'+huwikisource' => [ 100 ],
'+hywikisource' => [ 100 ],
'+idwikibooks' => [ 100, 102 ], // T4282
'+idwikisource' => [ 100 ],
'+itwikisource' => [ 102 ],
'+itwikivoyage' => [ 100, 104 ], // T57620
'+kowikisource' => [ 100 ],
'+lawikisource' => [ 102 ],
'+ltwikipedia' => [ 104 ], // T144118
'+mediawikiwiki' => [ 100, 102, 104, 106 ], // Manuals, extensions, Api & skin - T86391
'+metawiki' => [ NS_HELP ], // T45687
'+mlwikisource' => [ 100 ],
'+nlwikisource' => [ 102 ],
'+nowikisource' => [ 102 ],
'+plwikisource' => [ 104, 124 ], // T154711
'+ptwikisource' => [ 102 ],
'+rowikisource' => [ 102 ], // Follow-up for T31190
'+srwikibooks' => [ 102, ], // T17282
'+srwikisource' => [ 100 ],
'+svwikisource' => [ 106 ],
'+tewikisource' => [ 102 ],
'+trwikibooks' => [ 100, 110, ],
'+trwikisource' => [ 100 ],
'+ukwikisource' => [ 102, 114 ], // T52561, T53684
'+vecwikisource' => [ 100 ],
'+viwikibooks' => [ 104, 106 ],
'+viwikisource' => [ 102 ],
'+wikitech' => [ NS_HELP, 116 ], // Tools - T122865
'+zhwikisource' => [ 102, 114 ], // T66127
'+dewikivoyage' => [ 104 ],
'+commonswiki' => [ 6 ], // T167077
];
$wgNamespacesToBeSearchedDefault = [
'default' => [ 0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 0, 13 => 0 ],
'+arwikisource' => [ 102 => 1 ],
'+aswikisource' => [ 104 => 1, 106 => 1 ], // T45129
'+bgwiki' => [ 100 => 1, 101 => 0 ],
'+bgwikisource' => [ 100 => 1 ],
'+brwikisource' => [ 100 => 1, 104 => 1 ],
'+cawikisource' => [ 104 => 1, 106 => 1 ],
'+cswiki' => [ 100 => 1, 101 => 0, 102 => 1 ],
'+commonswiki' => [ 6 => 1, 12 => 1, 14 => 1, 100 => 1, 106 => 1 ],
'+cswikinews' => [ 14 => 0, 15 => 0 ],
'+cswikiquote' => [ 14 => 0, 15 => 0, 100 => 1, 101 => 0 ],
'+cswikisource' => [ 100 => 1, 101 => 0 ],
'+cswikiversity' => [ 14 => 0, 15 => 0, 100 => 0, 101 => 0 ],
'+dawikisource' => [ 102 => 1, 106 => 1 ],
'+dewikisource' => [ 102 => 1, 104 => 1 ],
'+dewikiversity' => [ 106 => 1, 108 => 1 ],
'+dewikivoyage' => [ 6 => 1, 14 => 1, 100 => 1, 104 => 1, 106 => 1 ],
'+elwikisource' => [ 102 => 1, 108 => 1 ],
'+enwikibooks' => [ 4 => 1, 112 => 1 ],
'+enwikinews' => [ 14 => 1, ], // T87522
'+enwikisource' => [ 100 => 1, 102 => 1, 106 => 1, 114 => 1 ], // T52007, T167511
'+eswiki' => [ 100 => 1, 104 => 1 ],
'+eswikisource' => [ 104 => 1 ],
'+etwikisource' => [ 104 => 1, 106 => 1 ],
'+fawikisource' => [ 102 => 1 ],
'+frrwiki' => [ 102 => 1, 104 => 1, 106 => 1 ], // T40023
'+frwikisource' => [ 102 => 1, 112 => 1 ],
'+frwikiversity' => [ 104 => 1, 106 => 1, 108 => 1 ],
'+frwiktionary' => [ 100 => 1, 106 => 1, ], // T94698
'+hewikisource' => [ 108 => 1, 112 => 1 ],
'+hewiktionary' => [ 14 => 1 ],
'+hrwikisource' => [ 100 => 1, 104 => 1 ],
'+huwikisource' => [ 100 => 1, 106 => 1 ],
'+hywikisource' => [ 100 => 1, 106 => 1 ],
'+idwikibooks' => [ 100 => 1, 102 => 1 ],
'+idwikisource' => [ 100 => 1, 102 => 1 ],
'+iswikisource' => [ 100 => 1, 102 => 1 ], // T46164
'+itwikisource' => [ 102 => 1, 110 => 1 ],
'+itwikiversity' => [ 100 => 1, 102 => 1, 104 => 1 ], // T114932
'+itwikivoyage' => [ 100 => 1, 104 => 1, 106 => 1 ],
'+kowikisource' => [ 100 => 1 ],
'+lawikisource' => [ 102 => 1, 106 => 1 ],
'+wikitech' => [ 12 => 1, 116 => 1, 498 => 1 ],
'+ltwiki' => [ 100 => 1 ],
'+mediawikiwiki' => [ 12 => 1, 100 => 1, 102 => 1, 104 => 1, 106 => 1 ], // T85807
'+metawiki' => [ 12 => 1, 200 => 1, 202 => 1 ],
'+mlwikisource' => [ 100 => 1, 104 => 1 ],
'+nlwikisource' => [ 102 => 1 ],
'+nlwikivoyage' => [ 6 => 1, 14 => 1, 100 => 1, 104 => 1, 106 => 1 ],
'+nowikisource' => [ 102 => 1, 106 => 1 ],
'+plwiktionary' => [ 100 => 1, 102 => 1 ],
'+plwikisource' => [ 102 => 1, 104 => 1, 124 => 1, ], // T154711
'+ptwikisource' => [ 102 => 1, 104 => 1 ],
'+rowikisource' => [ 102 => 1, 106 => 1 ], // T31190
'+ruwiki' => [ 104 => 0, 105 => 0, 106 => 0, 107 => 0 ],
'+ruwikisource' => [ 106 => 1 ],
'+ruwikivoyage' => [ 6 => 1, 14 => 1, 100 => 1, 104 => 1, 106 => 1 ],
'+sewikimedia' => [ 100 => 1 ], // T48882
'+slwikisource' => [ 104 => 1 ],
'+sourceswiki' => [ 106 => 1 ],
'+svwikisource' => [ 106 => 1, 108 => 1 ],
'+svwikivoyage' => [ 6 => 1, 14 => 1, 100 => 1, 104 => 1, 106 => 1 ],
'+strategywiki' => [ 106 => 1, 107 => 1 ], // T22514
'+tewikisource' => [ 102 => 1, 106 => 1 ],
'+tlwikibooks' => [ 100 => 1, 101 => 0 ],
'+trwikisource' => [ 100 => 1 ],
'+ukwikinews' => [ 14 => 1 ], // T51335
'+ukwikisource' => [ 102 => 1, 114 => 1, 252 => 1 ], // T52561, T53684
'+vecwikisource' => [ 100 => 1, 104 => 1 ],
'+viwikibooks' => [ 102 => 1, 104 => 1, 106 => 1 ],
'+viwikisource' => [ 102 => 1, 106 => 1 ],
'+wikidatawiki' => [ 120 => 1 ],
'+zhwikisource' => [ 102 => 1, 106 => 1, 114 => 1 ], // T66127
];
foreach ( $wgContentNamespaces as $wiki => $namespaces ) {
if( !isset($wgNamespacesToBeSearchedDefault[$wiki]) ) {
echo "Not searching [" . implode(', ', $namespaces) . "] for $wiki\n";
} else {
foreach($namespaces as $namespace) {
if( !isset($wgNamespacesToBeSearchedDefault[$wiki][$namespace]) ) {
echo "Not searching $namespace for $wiki\n";
}
}
}
}