MediaWiki master
LocalFile.php
Go to the documentation of this file.
1<?php
6
7namespace MediaWiki\FileRepo\File;
8
9use InvalidArgumentException;
10use MediaWiki\Content\ContentHandler;
11use MediaWiki\Context\RequestContext;
12use MediaWiki\Deferred\AutoCommitUpdate;
13use MediaWiki\Deferred\DeferredUpdates;
14use MediaWiki\Deferred\LinksUpdate\LinksUpdate;
15use MediaWiki\Deferred\SiteStatsUpdate;
16use MediaWiki\FileRepo\FileRepo;
17use MediaWiki\FileRepo\LocalRepo;
18use MediaWiki\JobQueue\Jobs\HTMLCacheUpdateJob;
19use MediaWiki\JobQueue\Jobs\ThumbnailRenderJob;
20use MediaWiki\Language\Language;
21use MediaWiki\Logger\LoggerFactory;
22use MediaWiki\Logging\LogEntryBase;
23use MediaWiki\Logging\ManualLogEntry;
24use MediaWiki\MainConfigNames;
25use MediaWiki\Media\MediaHandler;
26use MediaWiki\MediaWikiServices;
27use MediaWiki\Page\Article;
28use MediaWiki\Page\WikiFilePage;
29use MediaWiki\Parser\ParserOptions;
30use MediaWiki\Permissions\Authority;
31use MediaWiki\Revision\SlotRecord;
32use MediaWiki\Status\Status;
33use MediaWiki\Storage\PageUpdater;
34use MediaWiki\Title\Title;
35use MediaWiki\User\UserIdentity;
36use MediaWiki\User\UserIdentityValue;
37use MediaWiki\Utils\MWFileProps;
38use MediaWiki\WikiMap\WikiMap;
39use RuntimeException;
40use stdClass;
41use UnexpectedValueException;
42use Wikimedia\FileBackend\FileBackend;
43use Wikimedia\FileBackend\FileBackendError;
44use Wikimedia\FileBackend\FSFile\FSFile;
45use Wikimedia\LockManager\LockManager;
46use Wikimedia\Rdbms\Blob;
47use Wikimedia\Rdbms\IDBAccessObject;
48use Wikimedia\Rdbms\IReadableDatabase;
49use Wikimedia\Rdbms\IResultWrapper;
50use Wikimedia\Rdbms\SelectQueryBuilder;
51use Wikimedia\Timestamp\ConvertibleTimestamp;
52use Wikimedia\Timestamp\TimestampFormat as TS;
53
80class LocalFile extends File {
81 private const VERSION = 13; // cache version
82
83 private const CACHE_FIELD_MAX_LEN = 1000;
84
86 private const MDS_EMPTY = 'empty';
87
89 private const MDS_LEGACY = 'legacy';
90
92 private const MDS_PHP = 'php';
93
95 private const MDS_JSON = 'json';
96
98 private const MAX_PAGE_RENDER_JOBS = 50;
99
101 protected $fileExists;
102
104 private $fileId;
105
107 private $fileTypeId;
108
110 protected $width;
111
113 protected $height;
114
116 protected $bits;
117
119 protected $media_type;
120
122 protected $mime;
123
125 protected $size;
126
128 protected $metadataArray = [];
129
137
139 protected $metadataBlobs = [];
140
148
150 protected $sha1;
151
153 protected $dataLoaded = false;
154
156 protected $extraDataLoaded = false;
157
159 protected $deleted;
160
162 protected $file_id;
163
166
168 protected $repoClass = LocalRepo::class;
169
171 private $historyLine = 0;
172
174 private $historyRes = null;
175
177 private $major_mime;
178
180 private $minor_mime;
181
183 private $timestamp;
184
186 private $user;
187
189 private $description;
190
192 private $descriptionTouched;
193
195 private $upgraded = false;
196
198 private $upgrading;
199
201 private $locked;
202
204 private $lockedOwnTrx;
205
207 private $missing;
208
210 private $metadataStorageHelper;
211
213 private $migrationStage = SCHEMA_COMPAT_OLD;
214
215 // @note: higher than IDBAccessObject constants
216 private const LOAD_ALL = 16; // integer; load all the lazy fields too (like metadata)
217
218 private const ATOMIC_SECTION_LOCK = 'LocalFile::lockingTransaction';
219
232 public static function newFromTitle( $title, $repo, $unused = null ): static {
233 return new static( $title, $repo );
234 }
235
245 public static function newFromRow( $row, $repo ): static {
246 $title = Title::makeTitle( NS_FILE, $row->img_name );
247 $file = new static( $title, $repo );
248 $file->loadFromRow( $row );
249
250 return $file;
251 }
252
264 public static function newFromKey( $sha1, $repo, $timestamp = false ): static|false {
265 $dbr = $repo->getReplicaDB();
266 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
267
268 $queryBuilder->where( [ 'img_sha1' => $sha1 ] );
269
270 if ( $timestamp ) {
271 $queryBuilder->andWhere( [ 'img_timestamp' => $dbr->timestamp( $timestamp ) ] );
272 }
273
274 $row = $queryBuilder->caller( __METHOD__ )->fetchRow();
275 if ( $row ) {
276 return static::newFromRow( $row, $repo );
277 } else {
278 return false;
279 }
280 }
281
302 public static function getQueryInfo( array $options = [] ) {
303 wfDeprecated( __METHOD__, '1.41' );
304 $dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
305 $queryInfo = FileSelectQueryBuilder::newForFile( $dbr, $options )->getQueryInfo();
306 // needs remapping...
307 return [
308 'tables' => $queryInfo['tables'],
309 'fields' => $queryInfo['fields'],
310 'joins' => $queryInfo['join_conds'],
311 ];
312 }
313
321 public function __construct( $title, $repo ) {
322 parent::__construct( $title, $repo );
323 $this->metadataStorageHelper = new MetadataStorageHelper( $repo );
324 $this->migrationStage = MediaWikiServices::getInstance()->getMainConfig()->get(
326 );
327
328 $this->assertRepoDefined();
329 $this->assertTitleDefined();
330 }
331
335 public function getRepo() {
336 return $this->repo;
337 }
338
345 protected function getCacheKey() {
346 return $this->repo->getSharedCacheKey( 'file', sha1( $this->getName() ) );
347 }
348
352 private function loadFromCache() {
353 $this->dataLoaded = false;
354 $this->extraDataLoaded = false;
355
356 $key = $this->getCacheKey();
357 if ( !$key ) {
358 $this->loadFromDB( IDBAccessObject::READ_NORMAL );
359
360 return;
361 }
362
363 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
364 $cachedValues = $cache->getWithSetCallback(
365 $key,
366 $cache::TTL_WEEK,
367 function ( $oldValue, &$ttl ) use ( $cache ) {
368 $this->loadFromDB( IDBAccessObject::READ_NORMAL );
369
370 $fields = $this->getCacheFields( '' );
371 $cacheVal = [];
372 $cacheVal['fileExists'] = $this->fileExists;
373 if ( $this->fileExists ) {
374 foreach ( $fields as $field ) {
375 $cacheVal[$field] = $this->$field;
376 }
377 }
378 if ( $this->user ) {
379 $cacheVal['user'] = $this->user->getId();
380 $cacheVal['user_text'] = $this->user->getName();
381 }
382
383 // Don't cache metadata items stored as blobs, since they tend to be large
384 if ( $this->metadataBlobs ) {
385 $cacheVal['metadata'] = array_diff_key(
386 $this->metadataArray, $this->metadataBlobs );
387 // Save the blob addresses
388 $cacheVal['metadataBlobs'] = $this->metadataBlobs;
389 } else {
390 $cacheVal['metadata'] = $this->metadataArray;
391 }
392
393 // Strip off excessive entries from the subset of fields that can become large.
394 // If the cache value gets too large and might not fit in the cache,
395 // causing repeat database queries for each access to the file.
396 foreach ( $this->getLazyCacheFields( '' ) as $field ) {
397 if ( isset( $cacheVal[$field] )
398 && strlen( serialize( $cacheVal[$field] ) ) > 100 * 1024
399 ) {
400 unset( $cacheVal[$field] ); // don't let the value get too big
401 if ( $field === 'metadata' ) {
402 unset( $cacheVal['metadataBlobs'] );
403 }
404 }
405 }
406
407 if ( !$this->fileExists ) {
408 $ttl = $cache::TTL_DAY;
409 }
410
411 return $cacheVal;
412 },
413 [ 'version' => self::VERSION ]
414 );
415
416 $this->fileExists = $cachedValues['fileExists'];
417 if ( $this->fileExists ) {
418 $this->setProps( $cachedValues );
419 }
420
421 $this->dataLoaded = true;
422 $this->extraDataLoaded = true;
423 foreach ( $this->getLazyCacheFields( '' ) as $field ) {
424 $this->extraDataLoaded = $this->extraDataLoaded && isset( $cachedValues[$field] );
425 }
426 }
427
431 public function invalidateCache() {
432 // RepoGroup::findFile() has a process cache of file existence and non-existence. Drop
433 // the entry for this file, or a later caller can get a stale result. For example, a
434 // parse of the description page before the upload caches that the file is missing.
435 $title = $this->getTitle();
436 if ( $title ) {
437 MediaWikiServices::getInstance()->getRepoGroup()->clearCache( $title );
438 }
439
440 $key = $this->getCacheKey();
441 if ( !$key ) {
442 return;
443 }
444
445 $this->repo->getPrimaryDB()->onTransactionPreCommitOrIdle(
446 static function () use ( $key ) {
447 MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key );
448 },
449 __METHOD__
450 );
451 }
452
460 public function loadFromFile( $path = null ) {
461 $props = $this->repo->getFileProps( $path ?? $this->getVirtualUrl() );
462 $this->setProps( $props );
463 }
464
472 protected function getCacheFields( $prefix = 'img_' ) {
473 if ( $prefix !== '' ) {
474 throw new InvalidArgumentException(
475 __METHOD__ . ' with a non-empty prefix is no longer supported.'
476 );
477 }
478
479 // See self::getQueryInfo() for the fetching of the data from the DB,
480 // self::loadFromRow() for the loading of the object from the DB row,
481 // and self::loadFromCache() for the caching, and self::setProps() for
482 // populating the object from an array of data.
483 return [ 'size', 'width', 'height', 'bits', 'media_type',
484 'major_mime', 'minor_mime', 'timestamp', 'sha1', 'description' ];
485 }
486
494 protected function getLazyCacheFields( $prefix = 'img_' ) {
495 if ( $prefix !== '' ) {
496 throw new InvalidArgumentException(
497 __METHOD__ . ' with a non-empty prefix is no longer supported.'
498 );
499 }
500
501 // Keep this in sync with the omit-lazy option in self::getQueryInfo().
502 return [ 'metadata' ];
503 }
504
510 protected function loadFromDB( $flags = 0 ) {
511 $fname = static::class . '::' . __FUNCTION__;
512
513 # Unconditionally set loaded=true, we don't want the accessors constantly rechecking
514 $this->dataLoaded = true;
515 $this->extraDataLoaded = true;
516
517 $dbr = ( $flags & IDBAccessObject::READ_LATEST )
518 ? $this->repo->getPrimaryDB()
519 : $this->repo->getReplicaDB();
520 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
521
522 $queryBuilder->where( [ 'img_name' => $this->getName() ] );
523 $row = $queryBuilder->caller( $fname )->fetchRow();
524
525 if ( $row ) {
526 $this->loadFromRow( $row );
527 } else {
528 $this->fileExists = false;
529 $this->mime = 'unknown/unknown';
530 }
531 }
532
538 protected function loadExtraFromDB() {
539 if ( !$this->title ) {
540 return; // Avoid hard failure when the file does not exist. T221812
541 }
542
543 $fname = static::class . '::' . __FUNCTION__;
544
545 # Unconditionally set loaded=true, we don't want the accessors constantly rechecking
546 $this->extraDataLoaded = true;
547
548 $db = $this->repo->getReplicaDB();
549 $fieldMap = $this->loadExtraFieldsWithTimestamp( $db, $fname );
550 if ( !$fieldMap ) {
551 $db = $this->repo->getPrimaryDB();
552 $fieldMap = $this->loadExtraFieldsWithTimestamp( $db, $fname );
553 }
554
555 if ( $fieldMap ) {
556 if ( isset( $fieldMap['metadata'] ) ) {
557 $this->loadMetadataFromDbFieldValue( $db, $fieldMap['metadata'] );
558 }
559 } else {
560 throw new RuntimeException( "Could not find data for image '{$this->getName()}'." );
561 }
562 }
563
569 private function loadExtraFieldsWithTimestamp( IReadableDatabase $dbr, $fname ) {
570 $fieldMap = false;
571
572 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
573 $queryBuilder->where( [ 'img_name' => $this->getName() ] )
574 ->andWhere( [ 'img_timestamp' => $dbr->timestamp( $this->getTimestamp() ) ] );
575 $row = $queryBuilder->caller( $fname )->fetchRow();
576 if ( $row ) {
577 $fieldMap = $this->unprefixRow( $row, 'img_' );
578 } else {
579 // File may have been uploaded over in the meantime; check the old versions
580 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $dbr );
581 $row = $queryBuilder->where( [ 'oi_name' => $this->getName() ] )
582 ->andWhere( [ 'oi_timestamp' => $dbr->timestamp( $this->getTimestamp() ) ] )
583 ->caller( __METHOD__ )->fetchRow();
584 if ( $row ) {
585 $fieldMap = $this->unprefixRow( $row, 'oi_' );
586 }
587 }
588
589 return $fieldMap;
590 }
591
597 protected function unprefixRow( $row, $prefix = 'img_' ) {
598 $array = (array)$row;
599 $prefixLength = strlen( $prefix );
600
601 // Double check prefix once
602 if ( !str_starts_with( array_key_first( $array ), $prefix ) ) {
603 throw new InvalidArgumentException( __METHOD__ . ': incorrect $prefix parameter' );
604 }
605
606 $decoded = [];
607 foreach ( $array as $name => $value ) {
608 $decoded[substr( $name, $prefixLength )] = $value;
609 }
610
611 return $decoded;
612 }
613
629 public function loadFromRow( $row, $prefix = 'img_' ) {
630 $this->dataLoaded = true;
631
632 $unprefixed = $this->unprefixRow( $row, $prefix );
633
634 $this->name = $unprefixed['name'];
635 $this->media_type = $unprefixed['media_type'];
636
637 $services = MediaWikiServices::getInstance();
638 $this->description = $services->getCommentStore()
639 ->getComment( "{$prefix}description", $row )->text;
640
641 $this->user = $services->getUserFactory()->newFromAnyId(
642 $unprefixed['user'] ?? null,
643 $unprefixed['user_text'] ?? null,
644 $unprefixed['actor'] ?? null
645 );
646
647 $this->timestamp = wfTimestamp( TS::MW, $unprefixed['timestamp'] );
648
650 $this->repo->getReplicaDB(), $unprefixed['metadata'] );
651
652 if ( empty( $unprefixed['major_mime'] ) ) {
653 $this->major_mime = 'unknown';
654 $this->minor_mime = 'unknown';
655 $this->mime = 'unknown/unknown';
656 } else {
657 if ( !$unprefixed['minor_mime'] ) {
658 $unprefixed['minor_mime'] = 'unknown';
659 }
660 $this->major_mime = $unprefixed['major_mime'];
661 $this->minor_mime = $unprefixed['minor_mime'];
662 $this->mime = $unprefixed['major_mime'] . '/' . $unprefixed['minor_mime'];
663 }
664
665 // Trim zero padding from char/binary field
666 $this->sha1 = rtrim( $unprefixed['sha1'], "\0" );
667
668 // Normalize some fields to integer type, per their database definition.
669 // Use unary + so that overflows will be upgraded to double instead of
670 // being truncated as with intval(). This is important to allow > 2 GiB
671 // files on 32-bit systems.
672 $this->size = +$unprefixed['size'];
673 $this->width = +$unprefixed['width'];
674 $this->height = +$unprefixed['height'];
675 $this->bits = +$unprefixed['bits'];
676
677 // Check for extra fields (deprecated since MW 1.37)
678 $extraFields = array_diff(
679 array_keys( $unprefixed ),
680 [
681 'name', 'media_type', 'description_text', 'description_data',
682 'description_cid', 'user', 'user_text', 'actor', 'timestamp',
683 'metadata', 'major_mime', 'minor_mime', 'sha1', 'size', 'width',
684 'height', 'bits', 'file_id', 'filerevision_id'
685 ]
686 );
687 if ( $extraFields ) {
689 'Passing extra fields (' .
690 implode( ', ', $extraFields )
691 . ') to ' . __METHOD__ . ' was deprecated in MediaWiki 1.37. ' .
692 'Property assignment will be removed in a later version.',
693 '1.37' );
694 foreach ( $extraFields as $field ) {
695 $this->$field = $unprefixed[$field];
696 }
697 }
698
699 $this->fileExists = true;
700 }
701
707 public function load( $flags = 0 ) {
708 if ( !$this->dataLoaded ) {
709 if ( $flags & IDBAccessObject::READ_LATEST ) {
710 $this->loadFromDB( $flags );
711 } else {
712 $this->loadFromCache();
713 }
714 }
715
716 if ( ( $flags & self::LOAD_ALL ) && !$this->extraDataLoaded ) {
717 // @note: loads on name/timestamp to reduce race condition problems
718 $this->loadExtraFromDB();
719 }
720 }
721
726 public function maybeUpgradeRow() {
727 if ( MediaWikiServices::getInstance()->getReadOnlyMode()->isReadOnly() || $this->upgrading ) {
728 return;
729 }
730
731 $upgrade = false;
732 $reserialize = false;
733 if ( $this->media_type === null || $this->mime == 'image/svg' ) {
734 $upgrade = true;
735 } else {
736 $handler = $this->getHandler();
737 if ( $handler ) {
738 $validity = $handler->isFileMetadataValid( $this );
739 if ( $validity === MediaHandler::METADATA_BAD ) {
740 $upgrade = true;
741 } elseif ( $validity === MediaHandler::METADATA_COMPATIBLE
742 && $this->repo->isMetadataUpdateEnabled()
743 ) {
744 $upgrade = true;
745 } elseif ( $this->repo->isJsonMetadataEnabled()
746 && $this->repo->isMetadataReserializeEnabled()
747 ) {
748 if ( $this->repo->isSplitMetadataEnabled() && $this->isMetadataOversize() ) {
749 $reserialize = true;
750 } elseif ( $this->metadataSerializationFormat !== self::MDS_EMPTY &&
751 $this->metadataSerializationFormat !== self::MDS_JSON ) {
752 $reserialize = true;
753 }
754 }
755 }
756 }
757
758 if ( $upgrade || $reserialize ) {
759 $this->upgrading = true;
760 // Defer updates unless in auto-commit CLI mode
761 DeferredUpdates::addCallableUpdate( function () use ( $upgrade ) {
762 $this->upgrading = false; // avoid duplicate updates
763 try {
764 if ( $upgrade ) {
765 $this->upgradeRow();
766 } else {
767 $this->reserializeMetadata();
768 }
769 } catch ( LocalFileLockError ) {
770 // let the other process handle it (or do it next time)
771 }
772 } );
773 }
774 }
775
779 public function getUpgraded() {
780 return $this->upgraded;
781 }
782
789 public function getFileIdFromName() {
790 if ( !$this->fileId ) {
791 $dbw = $this->repo->getPrimaryDB();
792 $id = $dbw->newSelectQueryBuilder()
793 ->select( 'file_id' )
794 ->from( 'file' )
795 ->where( [
796 'file_name' => $this->getName(),
797 'file_deleted' => 0
798 ] )
799 ->caller( __METHOD__ )
800 ->fetchField();
801 $this->fileId = $id;
802 }
803
804 return $this->fileId;
805 }
806
813 public function acquireFileIdFromName() {
814 $dbw = $this->repo->getPrimaryDB();
815 $id = $this->getFileIdFromName();
816 if ( $id ) {
817 return $id;
818 }
819 $id = $dbw->newSelectQueryBuilder()
820 ->select( 'file_id' )
821 ->from( 'file' )
822 ->where( [
823 'file_name' => $this->getName(),
824 ] )
825 ->caller( __METHOD__ )
826 ->fetchField();
827 if ( !$id ) {
828 $dbw->newInsertQueryBuilder()
829 ->insertInto( 'file' )
830 ->row( [
831 'file_name' => $this->getName(),
832 // The value will be updated later
833 'file_latest' => 0,
834 'file_deleted' => 0,
835 'file_type' => $this->getFileTypeId(),
836 ] )
837 ->caller( __METHOD__ )->execute();
838 $insertId = $dbw->insertId();
839 if ( !$insertId ) {
840 throw new RuntimeException( 'File entry could not be inserted' );
841 }
842 return $insertId;
843 } else {
844 // Undelete
845 $dbw->newUpdateQueryBuilder()
846 ->update( 'file' )
847 ->set( [ 'file_deleted' => 0 ] )
848 ->where( [ 'file_id' => $id ] )
849 ->caller( __METHOD__ )->execute();
850 return $id;
851 }
852 }
853
854 protected function getFileTypeId(): int {
855 if ( $this->fileTypeId ) {
856 return $this->fileTypeId;
857 }
858 [ $major, $minor ] = self::splitMime( $this->mime );
859 $dbw = $this->repo->getPrimaryDB();
860 $id = $dbw->newSelectQueryBuilder()
861 ->select( 'ft_id' )
862 ->from( 'filetypes' )
863 ->where( [
864 'ft_media_type' => $this->getMediaType(),
865 'ft_major_mime' => $major,
866 'ft_minor_mime' => $minor,
867 ] )
868 ->caller( __METHOD__ )
869 ->fetchField();
870 if ( $id ) {
871 $this->fileTypeId = $id;
872 return $id;
873 }
874 $dbw->newInsertQueryBuilder()
875 ->insertInto( 'filetypes' )
876 ->row( [
877 'ft_media_type' => $this->getMediaType(),
878 'ft_major_mime' => $major,
879 'ft_minor_mime' => $minor,
880 ] )
881 ->caller( __METHOD__ )->execute();
882
883 $id = $dbw->insertId();
884 if ( !$id ) {
885 throw new RuntimeException( 'File entry could not be inserted' );
886 }
887
888 $this->fileTypeId = $id;
889 return $id;
890 }
891
896 public function upgradeRow() {
897 $dbw = $this->repo->getPrimaryDB();
898
899 // Store the timestamp to use in the freshness condition. This will fail to match
900 // the image row if the image was reuploaded while the upgrade was in process.
901 $freshnessTimestamp = $dbw->timestamp( $this->getTimestamp() );
902
903 $this->loadFromFile();
904
905 # Don't destroy file info of missing files
906 if ( !$this->fileExists ) {
907 wfDebug( __METHOD__ . ": file does not exist, aborting" );
908
909 return;
910 }
911
912 [ $major, $minor ] = self::splitMime( $this->mime );
913
914 wfDebug( __METHOD__ . ': upgrading ' . $this->getName() . " to the current schema" );
915
916 $metadata = $this->getMetadataForDb( $dbw );
917 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
918 $dbw->newUpdateQueryBuilder()
919 ->update( 'image' )
920 ->set( [
921 'img_size' => $this->size,
922 'img_width' => $this->width,
923 'img_height' => $this->height,
924 'img_bits' => $this->bits,
925 'img_media_type' => $this->media_type,
926 'img_major_mime' => $major,
927 'img_minor_mime' => $minor,
928 'img_metadata' => $metadata,
929 'img_sha1' => $this->sha1,
930 ] )
931 ->where( [ 'img_name' => $this->getName() ] )
932 ->andWhere( [ 'img_timestamp' => $freshnessTimestamp ] )
933 ->caller( __METHOD__ )->execute();
934 }
935
936 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
937 $fileId = $this->acquireFileIdFromName();
938 // Clear the cached file type ID so it will be recalculated with the new MIME type
939 $this->fileTypeId = 0;
940 $dbw->newUpdateQueryBuilder()
941 ->update( 'file' )
942 ->set( [ 'file_type' => $this->getFileTypeId() ] )
943 ->where( [ 'file_id' => $fileId ] )
944 ->caller( __METHOD__ )->execute();
945 $dbw->newUpdateQueryBuilder()
946 ->update( 'filerevision' )
947 ->set( [
948 'fr_size' => $this->size,
949 'fr_width' => $this->width,
950 'fr_height' => $this->height,
951 'fr_bits' => $this->bits,
952 'fr_metadata' => $metadata,
953 'fr_sha1' => $this->sha1,
954 ] )
955 ->where( [ 'fr_file' => $fileId ] )
956 ->andWhere( [ 'fr_timestamp' => $freshnessTimestamp ] )
957 ->caller( __METHOD__ )->execute();
958 }
959
960 $this->invalidateCache();
961
962 $this->upgraded = true; // avoid rework/retries
963 }
964
969 protected function reserializeMetadata() {
970 if ( MediaWikiServices::getInstance()->getReadOnlyMode()->isReadOnly() ) {
971 return;
972 }
973 $dbw = $this->repo->getPrimaryDB();
974 $metadata = $this->getMetadataForDb( $dbw );
975 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
976 $dbw->newUpdateQueryBuilder()
977 ->update( 'image' )
978 ->set( [ 'img_metadata' => $metadata ] )
979 ->where( [
980 'img_name' => $this->name,
981 'img_timestamp' => $dbw->timestamp( $this->timestamp ),
982 ] )
983 ->caller( __METHOD__ )->execute();
984 }
985 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
986 $dbw->newUpdateQueryBuilder()
987 ->update( 'filerevision' )
988 ->set( [ 'fr_metadata' => $metadata ] )
989 ->where( [ 'fr_file' => $this->acquireFileIdFromName() ] )
990 ->andWhere( [ 'fr_timestamp' => $dbw->timestamp( $this->getTimestamp() ) ] )
991 ->caller( __METHOD__ )->execute();
992 }
993 $this->upgraded = true;
994 }
995
1008 public function setProps( $info ) {
1009 $this->dataLoaded = true;
1010 $fields = $this->getCacheFields( '' );
1011 $fields[] = 'fileExists';
1012
1013 foreach ( $fields as $field ) {
1014 if ( isset( $info[$field] ) ) {
1015 $this->$field = $info[$field];
1016 }
1017 }
1018
1019 // Only our own cache sets these properties, so they both should be present.
1020 if ( isset( $info['user'] ) &&
1021 isset( $info['user_text'] ) &&
1022 $info['user_text'] !== ''
1023 ) {
1024 $this->user = new UserIdentityValue( $info['user'], $info['user_text'] );
1025 }
1026
1027 // Fix up mime fields
1028 if ( isset( $info['major_mime'] ) ) {
1029 $this->mime = "{$info['major_mime']}/{$info['minor_mime']}";
1030 } elseif ( isset( $info['mime'] ) ) {
1031 $this->mime = $info['mime'];
1032 [ $this->major_mime, $this->minor_mime ] = self::splitMime( $this->mime );
1033 }
1034
1035 if ( isset( $info['metadata'] ) ) {
1036 if ( is_string( $info['metadata'] ) ) {
1037 $this->loadMetadataFromString( $info['metadata'] );
1038 } elseif ( is_array( $info['metadata'] ) ) {
1039 $this->metadataArray = $info['metadata'];
1040 if ( isset( $info['metadataBlobs'] ) ) {
1041 $this->metadataBlobs = $info['metadataBlobs'];
1042 $this->unloadedMetadataBlobs = array_diff_key(
1043 $this->metadataBlobs,
1044 $this->metadataArray
1045 );
1046 } else {
1047 $this->metadataBlobs = [];
1048 $this->unloadedMetadataBlobs = [];
1049 }
1050 } else {
1051 $logger = LoggerFactory::getInstance( 'LocalFile' );
1052 $logger->warning( __METHOD__ . ' given invalid metadata of type ' .
1053 get_debug_type( $info['metadata'] ) );
1054 $this->metadataArray = [];
1055 }
1056 $this->extraDataLoaded = true;
1057 }
1058 }
1059
1067
1075 public function isMissing() {
1076 if ( $this->missing === null ) {
1077 $fileExists = $this->repo->fileExists( $this->getVirtualUrl() );
1078 $this->missing = !$fileExists;
1079 }
1080
1081 return $this->missing;
1082 }
1083
1091 public function getWidth( $page = 1 ) {
1092 $page = (int)$page;
1093 if ( $page < 1 ) {
1094 $page = 1;
1095 }
1096
1097 $this->load();
1098
1099 if ( $this->isMultipage() ) {
1100 $handler = $this->getHandler();
1101 if ( !$handler ) {
1102 return 0;
1103 }
1104 $dim = $handler->getPageDimensions( $this, $page );
1105 if ( $dim ) {
1106 return $dim['width'];
1107 } else {
1108 // For non-paged media, the false goes through an
1109 // intval, turning failure into 0, so do same here.
1110 return 0;
1111 }
1112 } else {
1113 return $this->width;
1114 }
1115 }
1116
1124 public function getHeight( $page = 1 ) {
1125 $page = (int)$page;
1126 if ( $page < 1 ) {
1127 $page = 1;
1128 }
1129
1130 $this->load();
1131
1132 if ( $this->isMultipage() ) {
1133 $handler = $this->getHandler();
1134 if ( !$handler ) {
1135 return 0;
1136 }
1137 $dim = $handler->getPageDimensions( $this, $page );
1138 if ( $dim ) {
1139 return $dim['height'];
1140 } else {
1141 // For non-paged media, the false goes through an
1142 // intval, turning failure into 0, so do same here.
1143 return 0;
1144 }
1145 } else {
1146 return $this->height;
1147 }
1148 }
1149
1156 public function getMetadata() {
1157 wfDeprecated( __METHOD__, '1.37' ); // since 1.47
1158 $data = $this->getMetadataArray();
1159 if ( !$data ) {
1160 return '';
1161 } elseif ( array_keys( $data ) === [ '_error' ] ) {
1162 // Legacy error encoding
1163 return $data['_error'];
1164 } else {
1165 return serialize( $this->getMetadataArray() );
1166 }
1167 }
1168
1175 public function getMetadataArray(): array {
1176 $this->load( self::LOAD_ALL );
1177 if ( $this->unloadedMetadataBlobs ) {
1178 return $this->getMetadataItems(
1179 array_unique( array_merge(
1180 array_keys( $this->metadataArray ),
1181 array_keys( $this->unloadedMetadataBlobs )
1182 ) )
1183 );
1184 }
1185 return $this->metadataArray;
1186 }
1187
1188 public function getMetadataItems( array $itemNames ): array {
1189 $this->load( self::LOAD_ALL );
1190 $result = [];
1191 $addresses = [];
1192 foreach ( $itemNames as $itemName ) {
1193 if ( array_key_exists( $itemName, $this->metadataArray ) ) {
1194 $result[$itemName] = $this->metadataArray[$itemName];
1195 } elseif ( isset( $this->unloadedMetadataBlobs[$itemName] ) ) {
1196 $addresses[$itemName] = $this->unloadedMetadataBlobs[$itemName];
1197 }
1198 }
1199
1200 if ( $addresses ) {
1201 $resultFromBlob = $this->metadataStorageHelper->getMetadataFromBlobStore( $addresses );
1202 foreach ( $addresses as $itemName => $address ) {
1203 unset( $this->unloadedMetadataBlobs[$itemName] );
1204 $value = $resultFromBlob[$itemName] ?? null;
1205 if ( $value !== null ) {
1206 $result[$itemName] = $value;
1207 $this->metadataArray[$itemName] = $value;
1208 }
1209 }
1210 }
1211 return $result;
1212 }
1213
1225 public function getMetadataForDb( IReadableDatabase $db ) {
1226 $this->load( self::LOAD_ALL );
1227 if ( !$this->metadataArray && !$this->metadataBlobs ) {
1228 $s = '';
1229 } elseif ( $this->repo->isJsonMetadataEnabled() ) {
1230 $s = $this->getJsonMetadata();
1231 } else {
1232 $s = serialize( $this->getMetadataArray() );
1233 }
1234 if ( !is_string( $s ) ) {
1235 throw new RuntimeException( 'Could not serialize image metadata value for DB' );
1236 }
1237 return $db->encodeBlob( $s );
1238 }
1239
1246 private function getJsonMetadata() {
1247 // Directly store data that is not already in BlobStore
1248 $envelope = [
1249 'data' => array_diff_key( $this->metadataArray, $this->metadataBlobs )
1250 ];
1251
1252 // Also store the blob addresses
1253 if ( $this->metadataBlobs ) {
1254 $envelope['blobs'] = $this->metadataBlobs;
1255 }
1256
1257 [ $s, $blobAddresses ] = $this->metadataStorageHelper->getJsonMetadata( $this, $envelope );
1258
1259 // Repeated calls to this function should not keep inserting more blobs
1260 $this->metadataBlobs += $blobAddresses;
1261
1262 return $s;
1263 }
1264
1271 private function isMetadataOversize() {
1272 if ( !$this->repo->isSplitMetadataEnabled() ) {
1273 return false;
1274 }
1275 $threshold = $this->repo->getSplitMetadataThreshold();
1276 $directItems = array_diff_key( $this->metadataArray, $this->metadataBlobs );
1277 foreach ( $directItems as $value ) {
1278 if ( strlen( $this->metadataStorageHelper->jsonEncode( $value ) ) > $threshold ) {
1279 return true;
1280 }
1281 }
1282 return false;
1283 }
1284
1293 protected function loadMetadataFromDbFieldValue( IReadableDatabase $db, $metadataBlob ) {
1294 $this->loadMetadataFromString( $db->decodeBlob( $metadataBlob ) );
1295 }
1296
1304 protected function loadMetadataFromString( $metadataString ) {
1305 $this->extraDataLoaded = true;
1306 $this->metadataArray = [];
1307 $this->metadataBlobs = [];
1308 $this->unloadedMetadataBlobs = [];
1309 $metadataString = (string)$metadataString;
1310 if ( $metadataString === '' ) {
1311 $this->metadataSerializationFormat = self::MDS_EMPTY;
1312 return;
1313 }
1314 if ( $metadataString[0] === '{' ) {
1315 $envelope = $this->metadataStorageHelper->jsonDecode( $metadataString );
1316 if ( !$envelope ) {
1317 // Legacy error encoding
1318 $this->metadataArray = [ '_error' => $metadataString ];
1319 $this->metadataSerializationFormat = self::MDS_LEGACY;
1320 } else {
1321 $this->metadataSerializationFormat = self::MDS_JSON;
1322 if ( isset( $envelope['data'] ) ) {
1323 $this->metadataArray = $envelope['data'];
1324 }
1325 if ( isset( $envelope['blobs'] ) ) {
1326 $this->metadataBlobs = $this->unloadedMetadataBlobs = $envelope['blobs'];
1327 }
1328 }
1329 } else {
1330 // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
1331 $data = @unserialize( $metadataString );
1332 if ( !is_array( $data ) ) {
1333 // Legacy error encoding
1334 $data = [ '_error' => $metadataString ];
1335 $this->metadataSerializationFormat = self::MDS_LEGACY;
1336 } else {
1337 $this->metadataSerializationFormat = self::MDS_PHP;
1338 }
1339 $this->metadataArray = $data;
1340 }
1341 }
1342
1347 public function getBitDepth() {
1348 $this->load();
1349
1350 return (int)$this->bits;
1351 }
1352
1358 public function getSize() {
1359 $this->load();
1360
1361 return $this->size;
1362 }
1363
1369 public function getMimeType() {
1370 $this->load();
1371
1372 return $this->mime;
1373 }
1374
1381 public function getMediaType() {
1382 $this->load();
1383
1384 return $this->media_type;
1385 }
1386
1392
1398 public function exists() {
1399 $this->load();
1400
1401 return $this->fileExists;
1402 }
1403
1409
1413
1425 protected function getThumbnails( $archiveName = false ) {
1426 if ( $archiveName ) {
1427 $dir = $this->getArchiveThumbPath( $archiveName );
1428 } else {
1429 $dir = $this->getThumbPath();
1430 }
1431
1432 $backend = $this->repo->getBackend();
1433 $files = [ $dir ];
1434 try {
1435 $iterator = $backend->getFileList( [ 'dir' => $dir, 'forWrite' => true ] );
1436 if ( $iterator !== null ) {
1437 foreach ( $iterator as $file ) {
1438 $files[] = $file;
1439 }
1440 }
1441 } catch ( FileBackendError ) {
1442 } // suppress (T56674)
1443
1444 return $files;
1445 }
1446
1471 private function getUrlForPurge() {
1472 // NOTE: Keep in sync with File::getUrl
1473 $this->assertRepoDefined();
1474 $ext = $this->getExtension();
1475 return $this->repo->getZoneUrl( 'public', $ext ) . '/' . $this->getUrlRel();
1476 }
1477
1486 public function purgeCache( $options = [] ) {
1487 // Refresh metadata in memcached, but don't touch thumbnails or CDN
1488 $this->maybeUpgradeRow();
1489 $this->invalidateCache();
1490
1491 // Delete thumbnails
1492 $this->purgeThumbnails( $options );
1493
1494 // Purge CDN cache for this file
1495 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
1496 $hcu->purgeUrls(
1497 $this->getUrlForPurge(),
1498 !empty( $options['forThumbRefresh'] )
1499 ? $hcu::PURGE_PRESEND // just a manual purge
1500 : $hcu::PURGE_INTENT_TXROUND_REFLECTED
1501 );
1502 }
1503
1509 public function purgeOldThumbnails( $archiveName ) {
1510 // Get a list of old thumbnails
1511 $thumbs = $this->getThumbnails( $archiveName );
1512
1513 // Delete thumbnails from storage, and prevent the directory itself from being purged
1514 $dir = array_shift( $thumbs );
1515 $this->purgeThumbList( $dir, $thumbs );
1516
1517 $urls = [];
1518 foreach ( $thumbs as $thumb ) {
1519 $urls[] = $this->getArchiveThumbUrl( $archiveName, $thumb );
1520 }
1521
1522 // Purge any custom thumbnail caches
1523 $this->getHookRunner()->onLocalFilePurgeThumbnails( $this, $archiveName, $urls );
1524
1525 // Purge the CDN
1526 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
1527 $hcu->purgeUrls( $urls, $hcu::PURGE_PRESEND );
1528 }
1529
1536 public function purgeThumbnails( $options = [] ) {
1537 $thumbs = $this->getThumbnails();
1538
1539 // Delete thumbnails from storage, and prevent the directory itself from being purged
1540 $dir = array_shift( $thumbs );
1541 $this->purgeThumbList( $dir, $thumbs );
1542
1543 // Always purge all files from CDN regardless of handler filters
1544 $urls = [];
1545 foreach ( $thumbs as $thumb ) {
1546 $urls[] = $this->getThumbUrl( $thumb );
1547 }
1548
1549 // Give the media handler a chance to filter the file purge list
1550 if ( !empty( $options['forThumbRefresh'] ) ) {
1551 $handler = $this->getHandler();
1552 if ( $handler ) {
1553 $handler->filterThumbnailPurgeList( $thumbs, $options );
1554 }
1555 }
1556
1557 // Purge any custom thumbnail caches
1558 $this->getHookRunner()->onLocalFilePurgeThumbnails( $this, false, $urls );
1559
1560 // Purge the CDN
1561 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
1562 $hcu->purgeUrls(
1563 $urls,
1564 !empty( $options['forThumbRefresh'] )
1565 ? $hcu::PURGE_PRESEND // just a manual purge
1566 : $hcu::PURGE_INTENT_TXROUND_REFLECTED
1567 );
1568 }
1569
1576 public function prerenderThumbnails() {
1577 $uploadThumbnailRenderMap = MediaWikiServices::getInstance()
1578 ->getMainConfig()->get( MainConfigNames::UploadThumbnailRenderMap );
1579
1580 $jobs = [];
1581
1582 $sizes = $uploadThumbnailRenderMap;
1583 rsort( $sizes );
1584
1585 foreach ( $sizes as $size ) {
1586 if ( $this->isMultipage() ) {
1587 // (T309114) Only trigger render jobs up to MAX_PAGE_RENDER_JOBS to avoid
1588 // a flood of jobs for huge files.
1589 $pageLimit = min( $this->pageCount(), self::MAX_PAGE_RENDER_JOBS );
1590
1591 $jobs[] = new ThumbnailRenderJob(
1592 $this->getTitle(),
1593 [
1594 'transformParams' => [ 'width' => $size, 'page' => 1 ],
1595 'enqueueNextPage' => true,
1596 'pageLimit' => $pageLimit
1597 ]
1598 );
1599 } elseif ( $this->isVectorized() || $this->getWidth() > $size ) {
1600 $jobs[] = new ThumbnailRenderJob(
1601 $this->getTitle(),
1602 [ 'transformParams' => [ 'width' => $size ] ]
1603 );
1604 }
1605 }
1606
1607 if ( $jobs ) {
1608 MediaWikiServices::getInstance()->getJobQueueGroup()->lazyPush( $jobs );
1609 }
1610 }
1611
1618 protected function purgeThumbList( $dir, $files ) {
1619 $fileListDebug = strtr(
1620 var_export( $files, true ),
1621 [ "\n" => '' ]
1622 );
1623 wfDebug( __METHOD__ . ": $fileListDebug" );
1624
1625 if ( $this->repo->supportsSha1URLs() ) {
1626 $reference = $this->getSha1();
1627 } else {
1628 $reference = $this->getName();
1629 }
1630
1631 $purgeList = [];
1632 foreach ( $files as $file ) {
1633 # Check that the reference (filename or sha1) is part of the thumb name
1634 # This is a basic check to avoid erasing unrelated directories
1635 if ( str_contains( $file, $reference )
1636 || str_contains( $file, "-thumbnail" ) // "short" thumb name
1637 ) {
1638 $purgeList[] = "{$dir}/{$file}";
1639 }
1640 }
1641
1642 # Delete the thumbnails
1643 $this->repo->quickPurgeBatch( $purgeList );
1644 # Clear out the thumbnail directory if empty
1645 $this->repo->quickCleanDir( $dir );
1646 }
1647
1650
1659 public function getHistory( $limit = null, $start = null, $end = null, $inc = true ) {
1660 if ( !$this->exists() ) {
1661 return []; // Avoid hard failure when the file does not exist. T221812
1662 }
1663
1664 $dbr = $this->repo->getReplicaDB();
1665 $oldFileQuery = FileSelectQueryBuilder::newForOldFile( $dbr )->getQueryInfo();
1666
1667 $tables = $oldFileQuery['tables'];
1668 $fields = $oldFileQuery['fields'];
1669 $join_conds = $oldFileQuery['join_conds'];
1670 $conds = $opts = [];
1671 $eq = $inc ? '=' : '';
1672 $conds[] = $dbr->expr( 'oi_name', '=', $this->title->getDBkey() );
1673
1674 if ( $start ) {
1675 $conds[] = $dbr->expr( 'oi_timestamp', "<$eq", $dbr->timestamp( $start ) );
1676 }
1677
1678 if ( $end ) {
1679 $conds[] = $dbr->expr( 'oi_timestamp', ">$eq", $dbr->timestamp( $end ) );
1680 }
1681
1682 if ( $limit ) {
1683 $opts['LIMIT'] = $limit;
1684 }
1685
1686 // Search backwards for time > x queries
1687 $order = ( !$start && $end !== null ) ? 'ASC' : 'DESC';
1688 $opts['ORDER BY'] = "oi_timestamp $order";
1689 $opts['USE INDEX'] = [ 'oldimage' => 'oi_name_timestamp' ];
1690
1691 $this->getHookRunner()->onLocalFile__getHistory( $this, $tables, $fields,
1692 $conds, $opts, $join_conds );
1693
1694 $res = $dbr->newSelectQueryBuilder()
1695 ->tables( $tables )
1696 ->fields( $fields )
1697 ->conds( $conds )
1698 ->caller( __METHOD__ )
1699 ->options( $opts )
1700 ->joinConds( $join_conds )
1701 ->fetchResultSet();
1702 $r = [];
1703
1704 foreach ( $res as $row ) {
1705 $r[] = $this->repo->newFileFromRow( $row );
1706 }
1707
1708 if ( $order == 'ASC' ) {
1709 $r = array_reverse( $r ); // make sure it ends up descending
1710 }
1711
1712 return $r;
1713 }
1714
1725 public function nextHistoryLine() {
1726 if ( !$this->exists() ) {
1727 return false; // Avoid hard failure when the file does not exist. T221812
1728 }
1729
1730 # Polymorphic function name to distinguish foreign and local fetches
1731 $fname = static::class . '::' . __FUNCTION__;
1732
1733 $dbr = $this->repo->getReplicaDB();
1734
1735 if ( $this->historyLine == 0 ) { // called for the first time, return line from cur
1736 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
1737
1738 $queryBuilder->fields( [ 'oi_archive_name' => $dbr->addQuotes( '' ), 'oi_deleted' => '0' ] )
1739 ->where( [ 'img_name' => $this->title->getDBkey() ] );
1740 $this->historyRes = $queryBuilder->caller( $fname )->fetchResultSet();
1741
1742 if ( $this->historyRes->numRows() == 0 ) {
1743 $this->historyRes = null;
1744
1745 return false;
1746 }
1747 } elseif ( $this->historyLine == 1 ) {
1748 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $dbr );
1749
1750 $this->historyRes = $queryBuilder->where( [ 'oi_name' => $this->title->getDBkey() ] )
1751 ->orderBy( 'oi_timestamp', SelectQueryBuilder::SORT_DESC )
1752 ->caller( $fname )->fetchResultSet();
1753 }
1754 $this->historyLine++;
1755
1756 return $this->historyRes->fetchObject();
1757 }
1758
1763 public function resetHistory() {
1764 $this->historyLine = 0;
1765
1766 if ( $this->historyRes !== null ) {
1767 $this->historyRes = null;
1768 }
1769 }
1770
1782
1804 public function upload( $src, $comment, $pageText, $flags = 0, $props = false,
1805 $timestamp = false, ?Authority $uploader = null, $tags = [],
1806 $createDummyRevision = true, $revert = false
1807 ) {
1808 if ( $this->getRepo()->getReadOnlyReason() !== false ) {
1809 return $this->readOnlyFatalStatus();
1810 } elseif ( MediaWikiServices::getInstance()->getRevisionStore()->isReadOnly() ) {
1811 // Check this in advance to avoid writing to FileBackend and the file tables,
1812 // only to fail on insert the revision due to the text store being unavailable.
1813 return $this->readOnlyFatalStatus();
1814 }
1815
1816 $srcPath = ( $src instanceof FSFile ) ? $src->getPath() : $src;
1817 if ( !$props ) {
1818 if ( FileRepo::isVirtualUrl( $srcPath )
1819 || FileBackend::isStoragePath( $srcPath )
1820 ) {
1821 $props = $this->repo->getFileProps( $srcPath );
1822 } else {
1823 $mwProps = new MWFileProps( MediaWikiServices::getInstance()->getMimeAnalyzer() );
1824 $props = $mwProps->getPropsFromPath( $srcPath, true );
1825 }
1826 }
1827
1828 $options = [];
1829 $handler = MediaHandler::getHandler( $props['mime'] );
1830 if ( $handler ) {
1831 if ( is_string( $props['metadata'] ) ) {
1832 // This supports callers directly fabricating a metadata
1833 // property using serialize(). Normally the metadata property
1834 // comes from MWFileProps, in which case it won't be a string.
1835 // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
1836 $metadata = @unserialize( $props['metadata'] );
1837 } else {
1838 $metadata = $props['metadata'];
1839 }
1840
1841 if ( is_array( $metadata ) ) {
1842 $options['headers'] = $handler->getContentHeaders( $metadata );
1843 }
1844 } else {
1845 $options['headers'] = [];
1846 }
1847
1848 // Trim spaces on user supplied text
1849 $comment = trim( $comment );
1850
1851 $status = $this->publish( $src, $flags, $options );
1852
1853 if ( $status->successCount >= 2 ) {
1854 // There will be a copy+(one of move,copy,store).
1855 // The first succeeding does not commit us to updating the DB
1856 // since it simply copied the current version to a timestamped file name.
1857 // It is only *preferable* to avoid leaving such files orphaned.
1858 // Once the second operation goes through, then the current version was
1859 // updated and we must therefore update the DB too.
1860 $oldver = $status->value;
1861
1862 $uploadStatus = $this->recordUpload3(
1863 $oldver,
1864 $comment,
1865 $pageText,
1866 $uploader ?? RequestContext::getMain()->getAuthority(),
1867 $props,
1868 $timestamp,
1869 $tags,
1870 $createDummyRevision,
1871 $revert
1872 );
1873 if ( !$uploadStatus->isOK() ) {
1874 if ( $uploadStatus->hasMessage( 'filenotfound' ) ) {
1875 // update filenotfound error with more specific path
1876 $status->fatal( 'filenotfound', $srcPath );
1877 } else {
1878 $status->merge( $uploadStatus );
1879 }
1880 }
1881 }
1882
1883 return $status;
1884 }
1885
1902 public function recordUpload3(
1903 string $oldver,
1904 string $comment,
1905 string $pageText,
1906 Authority $performer,
1907 $props = false,
1908 $timestamp = false,
1909 $tags = [],
1910 bool $createDummyRevision = true,
1911 bool $revert = false
1912 ): Status {
1913 $dbw = $this->repo->getPrimaryDB();
1914
1915 # Imports or such might force a certain timestamp; otherwise we generate
1916 # it and can fudge it slightly to keep (name,timestamp) unique on re-upload.
1917 if ( $timestamp === false ) {
1918 $timestamp = $dbw->timestamp();
1919 $allowTimeKludge = true;
1920 } else {
1921 $allowTimeKludge = false;
1922 }
1923
1924 $props = $props ?: $this->repo->getFileProps( $this->getVirtualUrl() );
1925 $props['description'] = $comment;
1926 $props['timestamp'] = wfTimestamp( TS::MW, $timestamp ); // DB -> TS::MW
1927 $this->setProps( $props );
1928
1929 # Fail now if the file isn't there
1930 if ( !$this->fileExists ) {
1931 wfDebug( __METHOD__ . ": File " . $this->getRel() . " went missing!" );
1932
1933 return Status::newFatal( 'filenotfound', $this->getRel() );
1934 }
1935
1936 $mimeAnalyzer = MediaWikiServices::getInstance()->getMimeAnalyzer();
1937 if ( !$mimeAnalyzer->isValidMajorMimeType( $this->major_mime ) ) {
1938 $this->major_mime = 'unknown';
1939 }
1940
1941 $actorNormalizaton = MediaWikiServices::getInstance()->getActorNormalization();
1942
1943 // T391473: File uploads can involve moving a lot of bytes around. Sometimes in
1944 // that time the DB connection can timeout. Normally this is automatically
1945 // reconnected, but reconnection does not work inside atomic sections.
1946 // Ping the DB to ensure it is still there prior to entering the atomic
1947 // section. TODO: Refactor upload jobs to be smarter about implicit transactions.
1948 $dbw->ping();
1949 $dbw->startAtomic( __METHOD__ );
1950
1951 $actorId = $actorNormalizaton->acquireActorId( $performer->getUser(), $dbw );
1952 $this->user = $performer->getUser();
1953 $commentStore = MediaWikiServices::getInstance()->getCommentStore();
1954
1955 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
1956 // Test to see if the row exists using INSERT IGNORE
1957 // This avoids race conditions by locking the row until the commit, and also
1958 // doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition.
1959 $commentFields = $commentStore->insert( $dbw, 'img_description', $comment );
1960 $actorFields = [ 'img_actor' => $actorId ];
1961 $dbw->newInsertQueryBuilder()
1962 ->insertInto( 'image' )
1963 ->ignore()
1964 ->row( [
1965 'img_name' => $this->getName(),
1966 'img_size' => $this->size,
1967 'img_width' => intval( $this->width ),
1968 'img_height' => intval( $this->height ),
1969 'img_bits' => $this->bits,
1970 'img_media_type' => $this->media_type,
1971 'img_major_mime' => $this->major_mime,
1972 'img_minor_mime' => $this->minor_mime,
1973 'img_timestamp' => $dbw->timestamp( $timestamp ),
1974 'img_metadata' => $this->getMetadataForDb( $dbw ),
1975 'img_sha1' => $this->sha1
1976 ] + $commentFields + $actorFields )
1977 ->caller( __METHOD__ )->execute();
1978 $reupload = ( $dbw->affectedRows() == 0 );
1979 } else {
1980 $reupload = $this->getFileIdFromName();
1981 }
1982
1983 if ( $reupload ) {
1984 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
1985 $row = $dbw->newSelectQueryBuilder()
1986 ->select( [ 'img_timestamp', 'img_sha1' ] )
1987 ->from( 'image' )
1988 ->where( [ 'img_name' => $this->getName() ] )
1989 ->caller( __METHOD__ )->fetchRow();
1990 } else {
1991 $row = $dbw->newSelectQueryBuilder()
1992 ->select( [
1993 'img_timestamp' => 'fr_timestamp',
1994 'img_sha1' => 'fr_sha1',
1995 ] )
1996 ->from( 'file' )
1997 ->join( 'filerevision', null, 'file_latest = fr_id' )
1998 ->where( [ 'file_id' => $this->getFileIdFromName() ] )
1999 ->caller( __METHOD__ )->fetchRow();
2000 }
2001
2002 if ( $row && $row->img_sha1 === $this->sha1 ) {
2003 $dbw->endAtomic( __METHOD__ );
2004 wfDebug( __METHOD__ . ": File " . $this->getRel() . " already exists!" );
2005 $title = Title::newFromText( $this->getName(), NS_FILE );
2006 return Status::newFatal( 'fileexists-no-change', $title->getPrefixedText() );
2007 }
2008 if ( $allowTimeKludge ) {
2009 # Use LOCK IN SHARE MODE to ignore any transaction snapshotting
2010 $lUnixtime = $row ? (int)wfTimestamp( TS::UNIX, $row->img_timestamp ) : false;
2011 # Avoid a timestamp that is not newer than the last version
2012 # TODO: the image/oldimage tables should be like page/revision with an ID field
2013 if ( $lUnixtime && (int)wfTimestamp( TS::UNIX, $timestamp ) <= $lUnixtime ) {
2014 sleep( 1 ); // fast enough re-uploads would go far in the future otherwise
2015 $timestamp = $dbw->timestamp( $lUnixtime + 1 );
2016 $this->timestamp = wfTimestamp( TS::MW, $timestamp ); // DB -> TS::MW
2017 }
2018 }
2019 }
2020 $latestFileRevId = null;
2021 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
2022 if ( $reupload ) {
2023 $latestFileRevId = $dbw->newSelectQueryBuilder()
2024 ->select( 'fr_id' )
2025 ->from( 'filerevision' )
2026 ->where( [ 'fr_file' => $this->acquireFileIdFromName() ] )
2027 ->orderBy( 'fr_timestamp', 'DESC' )
2028 ->caller( __METHOD__ )
2029 ->fetchField();
2030 }
2031 $commentFieldsNew = $commentStore->insert( $dbw, 'fr_description', $comment );
2032 $dbw->newInsertQueryBuilder()
2033 ->insertInto( 'filerevision' )
2034 ->row( [
2035 'fr_file' => $this->acquireFileIdFromName(),
2036 'fr_size' => $this->size,
2037 'fr_width' => intval( $this->width ),
2038 'fr_height' => intval( $this->height ),
2039 'fr_bits' => $this->bits,
2040 'fr_actor' => $actorId,
2041 'fr_deleted' => 0,
2042 'fr_timestamp' => $dbw->timestamp( $timestamp ),
2043 'fr_metadata' => $this->getMetadataForDb( $dbw ),
2044 'fr_sha1' => $this->sha1
2045 ] + $commentFieldsNew )
2046 ->caller( __METHOD__ )->execute();
2047 $dbw->newUpdateQueryBuilder()
2048 ->update( 'file' )
2049 ->set( [ 'file_latest' => $dbw->insertId() ] )
2050 ->where( [ 'file_id' => $this->getFileIdFromName() ] )
2051 ->caller( __METHOD__ )->execute();
2052 }
2053
2054 if ( $reupload ) {
2055 if ( ( $this->migrationStage & SCHEMA_COMPAT_WRITE_NEW ) && $latestFileRevId && $oldver ) {
2056 $dbw->newUpdateQueryBuilder()
2057 ->update( 'filerevision' )
2058 ->set( [ 'fr_archive_name' => $oldver ] )
2059 ->where( [ 'fr_id' => $latestFileRevId ] )
2060 ->caller( __METHOD__ )->execute();
2061 }
2062
2063 if ( $this->migrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
2064 $tables = [ 'image' ];
2065 $fields = [
2066 'oi_name' => 'img_name',
2067 'oi_archive_name' => $dbw->addQuotes( $oldver ),
2068 'oi_size' => 'img_size',
2069 'oi_width' => 'img_width',
2070 'oi_height' => 'img_height',
2071 'oi_bits' => 'img_bits',
2072 'oi_description_id' => 'img_description_id',
2073 'oi_timestamp' => 'img_timestamp',
2074 'oi_metadata' => 'img_metadata',
2075 'oi_media_type' => 'img_media_type',
2076 'oi_major_mime' => 'img_major_mime',
2077 'oi_minor_mime' => 'img_minor_mime',
2078 'oi_sha1' => 'img_sha1',
2079 'oi_actor' => 'img_actor',
2080 ];
2081 $joins = [];
2082 // (T36993) Note: $oldver can be empty here, if the previous
2083 // version of the file was broken. Allow registration of the new
2084 // version to continue anyway, because that's better than having
2085 // an image that's not fixable by user operations.
2086 // Collision, this is an update of a file
2087 // Insert previous contents into oldimage
2088 $dbw->insertSelect( 'oldimage', $tables, $fields,
2089 [ 'img_name' => $this->getName() ], __METHOD__, [], [], $joins );
2090
2091 // Update the current image row
2092 $commentFields = $commentStore->insert( $dbw, 'img_description', $comment );
2093 $actorFields = [ 'img_actor' => $actorId ];
2094 $dbw->newUpdateQueryBuilder()
2095 ->update( 'image' )
2096 ->set( [
2097 'img_size' => $this->size,
2098 'img_width' => intval( $this->width ),
2099 'img_height' => intval( $this->height ),
2100 'img_bits' => $this->bits,
2101 'img_media_type' => $this->media_type,
2102 'img_major_mime' => $this->major_mime,
2103 'img_minor_mime' => $this->minor_mime,
2104 'img_timestamp' => $dbw->timestamp( $timestamp ),
2105 'img_metadata' => $this->getMetadataForDb( $dbw ),
2106 'img_sha1' => $this->sha1
2107 ] + $commentFields + $actorFields )
2108 ->where( [ 'img_name' => $this->getName() ] )
2109 ->caller( __METHOD__ )->execute();
2110 }
2111 }
2112
2113 $descTitle = $this->getTitle();
2114 $descId = $descTitle->getArticleID();
2115 $wikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $descTitle );
2116 if ( !$wikiPage instanceof WikiFilePage ) {
2117 throw new UnexpectedValueException( 'Cannot obtain instance of WikiFilePage for ' . $this->getName()
2118 . ', got instance of ' . get_class( $wikiPage ) );
2119 }
2120 $wikiPage->setFile( $this );
2121
2122 // Determine log action. If reupload is done by reverting, use a special log_action.
2123 if ( $revert ) {
2124 $logAction = 'revert';
2125 } elseif ( $reupload ) {
2126 $logAction = 'overwrite';
2127 } else {
2128 $logAction = 'upload';
2129 }
2130 // Add the log entry...
2131 $logEntry = new ManualLogEntry( 'upload', $logAction );
2132 $logEntry->setTimestamp( $this->timestamp );
2133 $logEntry->setPerformer( $performer->getUser() );
2134 $logEntry->setComment( $comment );
2135 $logEntry->setTarget( $descTitle );
2136 // Allow people using the api to associate log entries with the upload.
2137 // Log has a timestamp, but sometimes different from upload timestamp.
2138 $logEntry->setParameters(
2139 [
2140 'img_sha1' => $this->sha1,
2141 'img_timestamp' => $timestamp,
2142 ]
2143 );
2144 // Note we keep $logId around since during new image
2145 // creation, page doesn't exist yet, so log_page = 0
2146 // but we want it to point to the page we're making,
2147 // so we later modify the log entry.
2148 // For a similar reason, we avoid making an RC entry
2149 // now and wait until the page exists.
2150 $logId = $logEntry->insert();
2151
2152 if ( $descTitle->exists() ) {
2153 if ( $createDummyRevision ) {
2154 $services = MediaWikiServices::getInstance();
2155 // Use own context to get the action text in content language
2156 $formatter = $services->getLogFormatterFactory()->newFromEntry( $logEntry );
2157 $formatter->setContext( RequestContext::newExtraneousContext( $descTitle ) );
2158 $editSummary = $formatter->getPlainActionText();
2159
2160 $dummyRevRecord = $wikiPage->newPageUpdater( $performer->getUser() )
2161 ->setCause( PageUpdater::CAUSE_UPLOAD )
2162 ->saveDummyRevision( $editSummary, EDIT_SILENT );
2163
2164 // Associate dummy revision id
2165 $logEntry->setAssociatedRevId( $dummyRevRecord->getId() );
2166 }
2167
2168 $newPageContent = null;
2169 } else {
2170 // Make the description page and RC log entry post-commit
2171 $newPageContent = ContentHandler::makeContent( $pageText, $descTitle );
2172 }
2173
2174 // NOTE: Even after ending this atomic section, we are probably still in the implicit
2175 // transaction started by any prior master query in the request. We cannot yet safely
2176 // schedule jobs, see T263301.
2177 $dbw->endAtomic( __METHOD__ );
2178 $fname = __METHOD__;
2179
2180 # Do some cache purges after final commit so that:
2181 # a) Changes are more likely to be seen post-purge
2182 # b) They won't cause rollback of the log publish/update above
2183 $purgeUpdate = new AutoCommitUpdate(
2184 $dbw,
2185 __METHOD__,
2186 function () use (
2187 $reupload, $wikiPage, $newPageContent, $comment, $performer,
2188 $logEntry, $logId, $descId, $tags, $fname
2189 ) {
2190 # Update memcache after the commit
2191 $this->invalidateCache();
2192
2193 $updateLogPage = false;
2194 if ( $newPageContent ) {
2195 # New file page; create the description page.
2196 # There's already a log entry, so don't make a second RC entry
2197 # CDN and file cache for the description page are purged by doUserEditContent.
2198 $revRecord = $wikiPage->newPageUpdater( $performer->getUser() )
2199 ->setCause( PageUpdater::CAUSE_UPLOAD )
2200 ->setContent( SlotRecord::MAIN, $newPageContent )
2201 ->saveRevision( $comment, EDIT_NEW | EDIT_SUPPRESS_RC );
2202
2203 if ( $revRecord ) {
2204 // Associate new page revision id
2205 $logEntry->setAssociatedRevId( $revRecord->getId() );
2206
2207 // This relies on the resetArticleID() call in WikiPage::insertOn(),
2208 // which is triggered on $descTitle by doUserEditContent() above.
2209 $updateLogPage = $revRecord->getPageId();
2210 }
2211 } else {
2212 # Existing file page: invalidate description page cache
2213 $title = $wikiPage->getTitle();
2214 $title->invalidateCache();
2215 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
2216 $hcu->purgeTitleUrls( $title, $hcu::PURGE_INTENT_TXROUND_REFLECTED );
2217 # Allow the new file version to be patrolled from the page footer
2218 Article::purgePatrolFooterCache( $descId );
2219 }
2220
2221 # Update associated rev id. This should be done by $logEntry->insert() earlier,
2222 # but setAssociatedRevId() wasn't called at that point yet...
2223 $logParams = $logEntry->getParameters();
2224 $logParams['associated_rev_id'] = $logEntry->getAssociatedRevId();
2225 $update = [ 'log_params' => LogEntryBase::makeParamBlob( $logParams ) ];
2226 if ( $updateLogPage ) {
2227 # Also log page, in case where we just created it above
2228 $update['log_page'] = $updateLogPage;
2229 }
2230 $this->getRepo()->getPrimaryDB()->newUpdateQueryBuilder()
2231 ->update( 'logging' )
2232 ->set( $update )
2233 ->where( [ 'log_id' => $logId ] )
2234 ->caller( $fname )->execute();
2235
2236 $this->getRepo()->getPrimaryDB()->newInsertQueryBuilder()
2237 ->insertInto( 'log_search' )
2238 ->row( [
2239 'ls_field' => 'associated_rev_id',
2240 'ls_value' => (string)$logEntry->getAssociatedRevId(),
2241 'ls_log_id' => $logId,
2242 ] )
2243 ->caller( $fname )->execute();
2244
2245 # Add change tags, if any
2246 if ( $tags ) {
2247 $logEntry->addTags( $tags );
2248 }
2249
2250 # Uploads can be patrolled
2251 $logEntry->setIsPatrollable( true );
2252
2253 # Now that the log entry is up-to-date, make an RC entry.
2254 $logEntry->publish( $logId );
2255
2256 # Run hook for other updates (typically more cache purging)
2257 $this->getHookRunner()->onFileUpload( $this, $reupload, !$newPageContent );
2258
2259 if ( $reupload ) {
2260 # TODO: Can we reuse LocalFile::purgeCache here?
2261 # Delete old thumbnails
2262 $this->purgeThumbnails();
2263 # Remove the old file from the CDN cache
2264 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
2265 $hcu->purgeUrls( $this->getUrlForPurge(), $hcu::PURGE_INTENT_TXROUND_REFLECTED );
2266 } else {
2267 # Update backlink pages pointing to this title if created
2268 $blcFactory = MediaWikiServices::getInstance()->getBacklinkCacheFactory();
2269 LinksUpdate::queueRecursiveJobsForTable(
2270 $this->getTitle(),
2271 'imagelinks',
2272 'upload-image',
2273 $performer->getUser()->getName(),
2274 $blcFactory->getBacklinkCache( $this->getTitle() )
2275 );
2276 }
2277
2278 $this->prerenderThumbnails();
2279 }
2280 );
2281
2282 # Invalidate cache for all pages using this file
2283 $cacheUpdateJob = HTMLCacheUpdateJob::newForBacklinks(
2284 $this->getTitle(),
2285 'imagelinks',
2286 [ 'causeAction' => 'file-upload', 'causeAgent' => $performer->getUser()->getName() ]
2287 );
2288
2289 // NOTE: We are probably still in the implicit transaction started by DBO_TRX. We should
2290 // only schedule jobs after that transaction was committed, so a job queue failure
2291 // doesn't cause the upload to fail (T263301). Also, we should generally not schedule any
2292 // Jobs or the DeferredUpdates that assume the update is complete until after the
2293 // transaction has been committed and we are sure that the upload was indeed successful.
2294 $dbw->onTransactionCommitOrIdle( static function () use ( $reupload, $purgeUpdate, $cacheUpdateJob ) {
2295 DeferredUpdates::addUpdate( $purgeUpdate, DeferredUpdates::PRESEND );
2296
2297 if ( !$reupload ) {
2298 // This is a new file, so update the image count
2299 DeferredUpdates::addUpdate( SiteStatsUpdate::factory( [ 'images' => 1 ] ) );
2300 }
2301
2302 MediaWikiServices::getInstance()->getJobQueueGroup()->lazyPush( $cacheUpdateJob );
2303 }, __METHOD__ );
2304
2305 return Status::newGood();
2306 }
2307
2324 public function publish( $src, $flags = 0, array $options = [] ) {
2325 return $this->publishTo( $src, $this->getRel(), $flags, $options );
2326 }
2327
2344 protected function publishTo( $src, $dstRel, $flags = 0, array $options = [] ) {
2345 $srcPath = ( $src instanceof FSFile ) ? $src->getPath() : $src;
2346
2347 $repo = $this->getRepo();
2348 if ( $repo->getReadOnlyReason() !== false ) {
2349 return $this->readOnlyFatalStatus();
2350 }
2351
2352 $status = $this->acquireFileLock();
2353 if ( !$status->isOK() ) {
2354 return $status;
2355 }
2356
2357 if ( $this->isOld() ) {
2358 $archiveRel = $dstRel;
2359 $archiveName = basename( $archiveRel );
2360 } else {
2361 $archiveName = ConvertibleTimestamp::now( TS::MW ) . '!' . $this->getName();
2362 $archiveRel = $this->getArchiveRel( $archiveName );
2363 }
2364
2365 $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0;
2366 $status = $repo->publish( $srcPath, $dstRel, $archiveRel, $flags, $options );
2367
2368 if ( $status->value == 'new' ) {
2369 $status->value = '';
2370 } else {
2371 $status->value = $archiveName;
2372 }
2373
2374 $this->releaseFileLock();
2375 return $status;
2376 }
2377
2382
2396 public function move( $target ) {
2397 $localRepo = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo();
2398 if ( $this->getRepo()->getReadOnlyReason() !== false ) {
2399 return $this->readOnlyFatalStatus();
2400 }
2401
2402 wfDebugLog( 'imagemove', "Got request to move {$this->name} to " . $target->getText() );
2403 $batch = new LocalFileMoveBatch( $this, $target );
2404
2405 $status = $batch->addCurrent();
2406 if ( !$status->isOK() ) {
2407 return $status;
2408 }
2409 $archiveNames = $batch->addOlds();
2410 $status = $batch->execute();
2411
2412 wfDebugLog( 'imagemove', "Finished moving {$this->name}" );
2413
2414 // Purge the source and target files outside the transaction...
2415 $oldTitleFile = $localRepo->newFile( $this->title );
2416 $newTitleFile = $localRepo->newFile( $target );
2417 DeferredUpdates::addUpdate(
2418 new AutoCommitUpdate(
2419 $this->getRepo()->getPrimaryDB(),
2420 __METHOD__,
2421 static function () use ( $oldTitleFile, $newTitleFile, $archiveNames ) {
2422 $oldTitleFile->purgeEverything();
2423 foreach ( $archiveNames as $archiveName ) {
2425 '@phan-var OldLocalFile $oldTitleFile';
2426 $oldTitleFile->purgeOldThumbnails( $archiveName );
2427 }
2428 $newTitleFile->purgeEverything();
2429 }
2430 ),
2431 DeferredUpdates::PRESEND
2432 );
2433
2434 if ( $status->isOK() ) {
2435 // Now switch the object
2436 $this->title = $target;
2437 // Force regeneration of the name and hashpath
2438 $this->name = null;
2439 $this->hashPath = null;
2440 }
2441
2442 return $status;
2443 }
2444
2461 public function deleteFile( $reason, UserIdentity $user, $suppress = false ) {
2462 if ( $this->getRepo()->getReadOnlyReason() !== false ) {
2463 return $this->readOnlyFatalStatus();
2464 }
2465
2466 $batch = new LocalFileDeleteBatch( $this, $user, $reason, $suppress );
2467
2468 $batch->addCurrent();
2469 // Get old version relative paths
2470 $archiveNames = $batch->addOlds();
2471 $status = $batch->execute();
2472
2473 if ( $status->isOK() ) {
2474 DeferredUpdates::addUpdate( SiteStatsUpdate::factory( [ 'images' => -1 ] ) );
2475 }
2476
2477 // To avoid slow purges in the transaction, move them outside...
2478 DeferredUpdates::addUpdate(
2479 new AutoCommitUpdate(
2480 $this->getRepo()->getPrimaryDB(),
2481 __METHOD__,
2482 function () use ( $archiveNames ) {
2483 $this->purgeEverything();
2484 foreach ( $archiveNames as $archiveName ) {
2485 $this->purgeOldThumbnails( $archiveName );
2486 }
2487 }
2488 ),
2489 DeferredUpdates::PRESEND
2490 );
2491
2492 // Purge the CDN
2493 $purgeUrls = [];
2494 foreach ( $archiveNames as $archiveName ) {
2495 $purgeUrls[] = $this->getArchiveUrl( $archiveName );
2496 }
2497
2498 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
2499 $hcu->purgeUrls( $purgeUrls, $hcu::PURGE_INTENT_TXROUND_REFLECTED );
2500
2501 return $status;
2502 }
2503
2521 public function deleteOldFile( $archiveName, $reason, UserIdentity $user, $suppress = false ) {
2522 if ( $this->getRepo()->getReadOnlyReason() !== false ) {
2523 return $this->readOnlyFatalStatus();
2524 }
2525
2526 $batch = new LocalFileDeleteBatch( $this, $user, $reason, $suppress );
2527
2528 $batch->addOld( $archiveName );
2529 $status = $batch->execute();
2530
2531 $this->purgeOldThumbnails( $archiveName );
2532 if ( $status->isOK() ) {
2533 $this->purgeDescription();
2534 }
2535
2536 $url = $this->getArchiveUrl( $archiveName );
2537 $hcu = MediaWikiServices::getInstance()->getHTMLCacheUpdater();
2538 $hcu->purgeUrls( $url, $hcu::PURGE_INTENT_TXROUND_REFLECTED );
2539
2540 return $status;
2541 }
2542
2555 public function restore( $versions = [], $unsuppress = false ) {
2556 if ( $this->getRepo()->getReadOnlyReason() !== false ) {
2557 return $this->readOnlyFatalStatus();
2558 }
2559
2560 $batch = new LocalFileRestoreBatch( $this, $unsuppress );
2561
2562 if ( !$versions ) {
2563 $batch->addAll();
2564 } else {
2565 $batch->addIds( $versions );
2566 }
2567 $status = $batch->execute();
2568 if ( $status->isGood() ) {
2569 $cleanupStatus = $batch->cleanup();
2570 $cleanupStatus->successCount = 0;
2571 $cleanupStatus->failCount = 0;
2572 $status->merge( $cleanupStatus );
2573 }
2574
2575 return $status;
2576 }
2577
2582
2588 public function getDescriptionUrl() {
2589 // Avoid hard failure when the file does not exist. T221812
2590 return $this->title ? $this->title->getLocalURL() : false;
2591 }
2592
2600 public function getDescriptionShortUrl() {
2601 if ( !$this->title ) {
2602 return null; // Avoid hard failure when the file does not exist. T221812
2603 }
2604
2605 $pageId = $this->title->getArticleID();
2606 if ( !$pageId ) {
2607 return null;
2608 }
2609
2610 // T428296: This is intentionally unlocalised to produce a consistent and short URL
2611 $url = WikiMap::getForeignURL( WikiMap::getCurrentWikiId(), "Special:Redirect/page/$pageId" );
2612 if ( $url === false ) {
2613 return null;
2614 }
2615
2616 return $url;
2617 }
2618
2628 public function getDescriptionText( Language $lang ) {
2629 if ( !$this->title ) {
2630 return false; // Avoid hard failure when the file does not exist. T221812
2631 }
2632
2633 $services = MediaWikiServices::getInstance();
2634 $page = $services->getPageStore()->getPageByReference( $this->getTitle() );
2635 if ( !$page ) {
2636 return false;
2637 }
2638
2639 $parserOptions = ParserOptions::newFromUserAndLang(
2640 RequestContext::getMain()->getUser(),
2641 $lang
2642 );
2643 $parseStatus = $services->getParserOutputAccess()
2644 ->getParserOutput( $page, $parserOptions );
2645
2646 if ( !$parseStatus->isGood() ) {
2647 // Rendering failed.
2648 return false;
2649 }
2650 // TODO T371004 move runOutputPipeline out of $parserOutput
2651 return $parseStatus->getValue()->runOutputPipeline( $parserOptions, [] )->getContentHolderText();
2652 }
2653
2661 public function getUploader( int $audience = self::FOR_PUBLIC, ?Authority $performer = null ): ?UserIdentity {
2662 $this->load();
2663 if ( $audience === self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
2664 return null;
2665 } elseif ( $audience === self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $performer ) ) {
2666 return null;
2667 } else {
2668 return $this->user;
2669 }
2670 }
2671
2678 public function getDescription( $audience = self::FOR_PUBLIC, ?Authority $performer = null ) {
2679 $this->load();
2680 if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
2681 return '';
2682 } elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $performer ) ) {
2683 return '';
2684 } else {
2685 return $this->description;
2686 }
2687 }
2688
2693 public function getTimestamp() {
2694 $this->load();
2695
2696 return $this->timestamp;
2697 }
2698
2703 public function getDescriptionTouched() {
2704 if ( !$this->exists() ) {
2705 return false; // Avoid hard failure when the file does not exist. T221812
2706 }
2707
2708 // The DB lookup might return false, e.g. if the file was just deleted, or the shared DB repo
2709 // itself gets it from elsewhere. To avoid repeating the DB lookups in such a case, we
2710 // need to differentiate between null (uninitialized) and false (failed to load).
2711 if ( $this->descriptionTouched === null ) {
2712 $touched = $this->repo->getReplicaDB()->newSelectQueryBuilder()
2713 ->select( 'page_touched' )
2714 ->from( 'page' )
2715 ->where( [ 'page_namespace' => $this->title->getNamespace() ] )
2716 ->andWhere( [ 'page_title' => $this->title->getDBkey() ] )
2717 ->caller( __METHOD__ )->fetchField();
2718 $this->descriptionTouched = $touched ? wfTimestamp( TS::MW, $touched ) : false;
2719 }
2720
2721 return $this->descriptionTouched;
2722 }
2723
2728 public function getSha1() {
2729 $this->load();
2730 return $this->sha1;
2731 }
2732
2736 public function isCacheable() {
2737 $this->load();
2738
2739 // If extra data (metadata) was not loaded then it must have been large
2740 return $this->extraDataLoaded
2741 && strlen( serialize( $this->metadataArray ) ) <= self::CACHE_FIELD_MAX_LEN;
2742 }
2743
2756 public function acquireFileLock( $timeout = 0 ) {
2757 $status = Status::wrap( $this->getRepo()->getBackend()->lockFiles(
2758 [ $this->getPath() ], LockManager::LOCK_EX, $timeout
2759 ) );
2760
2761 if ( !$status->isOK() ) {
2762 $logger = LoggerFactory::getInstance( 'LocalFile' );
2763 if ( $status->hasMessage( 'lockmanager-fail-conflict' ) ) {
2764 $errorKey = 'lockmanager-fail-conflict';
2765 } else {
2766 $messages = $status->getMessages( 'error' );
2767 $errorKey = $messages ? $messages[0]->getKey() : 'unknown';
2768 }
2769 $logger->warning(
2770 "Failed to lock '{file}'",
2771 [
2772 'file' => $this->name,
2773 'error_key' => $errorKey,
2774 'exception' => new RuntimeException()
2775 ]
2776 );
2777 }
2778
2779 return $status;
2780 }
2781
2788 public function releaseFileLock() {
2789 $status = Status::wrap( $this->getRepo()->getBackend()->unlockFiles(
2790 [ $this->getPath() ], LockManager::LOCK_EX
2791 ) );
2792
2793 if ( !$status->isOK() ) {
2794 $logger = LoggerFactory::getInstance( 'LocalFile' );
2795 $messages = $status->getMessages( 'error' );
2796 $errorKey = $messages ? $messages[0]->getKey() : 'unknown';
2797 $logger->error(
2798 "Failed to unlock '{file}'",
2799 [
2800 'file' => $this->name,
2801 'error_key' => $errorKey,
2802 'exception' => new RuntimeException()
2803 ]
2804 );
2805 }
2806
2807 return $status;
2808 }
2809
2820 public function lock() {
2821 wfDeprecated( __METHOD__, '1.38' );
2822 if ( !$this->locked ) {
2823 $logger = LoggerFactory::getInstance( 'LocalFile' );
2824
2825 $dbw = $this->repo->getPrimaryDB();
2826 $makesTransaction = !$dbw->trxLevel();
2827 $dbw->startAtomic( self::ATOMIC_SECTION_LOCK );
2828 // T56736: use simple lock to handle when the file does not exist.
2829 // SELECT FOR UPDATE prevents changes, not other SELECTs with FOR UPDATE.
2830 // Also, that would cause contention on INSERT of similarly named rows.
2831 $status = $this->acquireFileLock( 10 ); // represents all versions of the file
2832 if ( !$status->isGood() ) {
2833 $dbw->endAtomic( self::ATOMIC_SECTION_LOCK );
2834 $logger->warning( "Failed to lock '{file}'", [ 'file' => $this->name ] );
2835
2836 throw new LocalFileLockError( $status );
2837 }
2838 // Release the lock *after* commit to avoid row-level contention.
2839 // Make sure it triggers on rollback() as well as commit() (T132921).
2840 $dbw->onTransactionResolution(
2841 function () use ( $logger ) {
2842 $status = $this->releaseFileLock();
2843 if ( !$status->isGood() ) {
2844 $logger->error( "Failed to unlock '{file}'", [ 'file' => $this->name ] );
2845 }
2846 },
2847 __METHOD__
2848 );
2849 // Callers might care if the SELECT snapshot is safely fresh
2850 $this->lockedOwnTrx = $makesTransaction;
2851 }
2852
2853 $this->locked++;
2854
2855 return $this->lockedOwnTrx;
2856 }
2857
2868 public function unlock() {
2869 wfDeprecated( __METHOD__, '1.47' );
2870 if ( $this->locked ) {
2871 wfDeprecated( __METHOD__, '1.38' );
2872 --$this->locked;
2873 if ( !$this->locked ) {
2874 $dbw = $this->repo->getPrimaryDB();
2875 $dbw->endAtomic( self::ATOMIC_SECTION_LOCK );
2876 $this->lockedOwnTrx = false;
2877 }
2878 }
2879 }
2880
2884 protected function readOnlyFatalStatus() {
2885 return $this->getRepo()->newFatal( 'filereadonlyerror', $this->getName(),
2886 $this->getRepo()->getName(), $this->getRepo()->getReadOnlyReason() );
2887 }
2888
2892 public function __destruct() {
2893 if ( $this->locked ) {
2894 $this->unlock();
2895 }
2896 }
2897}
2898
2900class_alias( LocalFile::class, 'LocalFile' );
const SCHEMA_COMPAT_OLD
Definition Defines.php:305
const SCHEMA_COMPAT_WRITE_OLD
Definition Defines.php:293
const NS_FILE
Definition Defines.php:57
const EDIT_SUPPRESS_RC
Definition Defines.php:126
const SCHEMA_COMPAT_WRITE_NEW
Definition Defines.php:297
const EDIT_SILENT
Do not notify other users (e.g.
Definition Defines.php:123
const EDIT_NEW
Article is assumed to be non-existent, fail if it exists.
Definition Defines.php:114
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfTimestamp( $outputtype=TS::UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:72
Deferrable Update for closure/callback updates that should use auto-commit mode.
static isVirtualUrl( $url)
Determine if a string is an mwrepo:// URL.
Definition FileRepo.php:288
static newForOldFile(IReadableDatabase $db, array $options=[])
static newForFile(IReadableDatabase $db, array $options=[])
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition File.php:80
assertTitleDefined()
Assert that $this->title is set to a Title.
Definition File.php:2605
getArchiveRel( $suffix=false)
Get the path of an archived file relative to the public zone root.
Definition File.php:1823
FileRepo LocalRepo ForeignAPIRepo false $repo
Some member variables can be lazy-initialised using __get().
Definition File.php:127
isDeleted( $field)
Is this file a "deleted" file in a private archive?
Definition File.php:2182
pageCount()
Returns the number of pages of a multipage document, or false for documents which aren't multipage do...
Definition File.php:2283
string null $path
The storage path corresponding to one of the zones.
Definition File.php:160
string null $url
The URL corresponding to one of the four basic zones.
Definition File.php:151
MediaHandler null $handler
Definition File.php:148
getTitle()
Return the associated title object.
Definition File.php:378
getHandler(?Language $lang=null)
Get a MediaHandler instance for this file.
Definition File.php:1648
userCan( $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this file, if it's marked as d...
Definition File.php:2478
isMultipage()
Returns 'true' if this file is a type which supports multiple pages, e.g.
Definition File.php:2272
string null $name
The name of a file from its title object.
Definition File.php:157
getRel()
Get the path of the file relative to the public zone root.
Definition File.php:1811
purgeDescription()
Purge the file description page, but don't go after pages using the file.
Definition File.php:1719
isVectorized()
Return true if the file is vectorized.
Definition File.php:697
getArchiveThumbUrl( $archiveName, $suffix=false)
Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified.
Definition File.php:1958
assertRepoDefined()
Assert that $this->repo is set to a valid FileRepo instance.
Definition File.php:2596
isOld()
Returns true if the image is an old version STUB.
Definition File.php:2170
Title string false $title
Definition File.php:130
getVirtualUrl( $suffix=false)
Get the public zone virtual URL for a current version source file.
Definition File.php:2041
getName()
Return the name of this file.
Definition File.php:348
purgeEverything()
Purge metadata and all affected pages when the file is created, deleted, or majorly updated.
Definition File.php:1732
getArchiveUrl( $suffix=false)
Get the URL of the archive directory, or a particular file if $suffix is specified.
Definition File.php:1937
getThumbUrl( $suffix=false)
Get the URL of the thumbnail directory, or a particular file if $suffix is specified.
Definition File.php:1995
getArchiveThumbPath( $archiveName, $suffix=false)
Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified.
Definition File.php:1898
getThumbPath( $suffix=false)
Get the path of the thumbnail directory, or a particular file if $suffix is specified.
Definition File.php:1912
getPath()
Return the storage path to the file.
Definition File.php:516
Local file in the wiki's own database.
Definition LocalFile.php:80
static getQueryInfo(array $options=[])
Return the tables, fields, and join conditions to be selected to create a new localfile object.
isMissing()
splitMime inherited
invalidateCache()
Purge the file object/metadata cache.
loadFromRow( $row, $prefix='img_')
Load file metadata from a DB result row.
unprefixRow( $row, $prefix='img_')
getDescriptionText(Language $lang)
Get the HTML text of the description page This is not used by ImagePage for local files,...
getDescriptionShortUrl()
Get short description URL for a file based on the page ID.
getMetadataForDb(IReadableDatabase $db)
Serialize the metadata array for insertion into img_metadata, oi_metadata or fa_metadata.
getWidth( $page=1)
Return the width of the image.
publishTo( $src, $dstRel, $flags=0, array $options=[])
Move or copy a file to a specified location.
static newFromTitle( $title, $repo, $unused=null)
Create a LocalFile from a title Do not call this except from inside a repo class.
getMetadataItems(array $itemNames)
Get multiple elements of the unserialized handler-specific metadata.
int $filerevision_id
id in filerevision table, null on read old
int $file_id
id in file table, null on read old
string $sha1
SHA-1 base 36 content hash.
bool $fileExists
Does the file exist on disk?
getMimeType()
Returns the MIME type of the file.
string $mime
MIME type, determined by MimeAnalyzer\guessMimeType.
int $bits
Returned by getimagesize (loadFromXxx).
getCacheFields( $prefix='img_')
Returns the list of object properties that are included as-is in the cache.
string[] $unloadedMetadataBlobs
Map of metadata item name to blob address for items that exist but have not yet been loaded into $thi...
deleteFile( $reason, UserIdentity $user, $suppress=false)
Delete all versions of the file.
getLazyCacheFields( $prefix='img_')
Returns the list of object properties that are included as-is in the cache, only when they're not too...
getHeight( $page=1)
Return the height of the image.
setProps( $info)
Set properties in this object to be equal to those given in the associative array $info.
array $metadataArray
Unserialized metadata.
loadMetadataFromString( $metadataString)
Unserialize a metadata string which came from some non-DB source, or is the return value of IReadable...
string[] $metadataBlobs
Map of metadata item name to blob address.
loadMetadataFromDbFieldValue(IReadableDatabase $db, $metadataBlob)
Unserialize a metadata blob which came from the database and store it in $this.
load( $flags=0)
Load file metadata from cache or DB, unless already loaded.
getMetadata()
Get handler-specific metadata as a serialized string.
reserializeMetadata()
Write the metadata back to the database with the current serialization format.
static newFromRow( $row, $repo)
Create a LocalFile from a title Do not call this except from inside a repo class.
deleteOldFile( $archiveName, $reason, UserIdentity $user, $suppress=false)
Delete an old version of the file.
unlock()
Decrement the lock reference count and end the atomic section if it reaches zero.
acquireFileIdFromName()
This is mostly for the migration period.
int $size
Size in bytes (loadFromXxx).
loadFromFile( $path=null)
Load metadata from the file itself.
string $media_type
MEDIATYPE_xxx (bitmap, drawing, audio...).
getDescriptionUrl()
isMultipage inherited
getSize()
Returns the size of the image file, in bytes.
publish( $src, $flags=0, array $options=[])
Move or copy a file to its public location.
nextHistoryLine()
Returns the history of this file, line by line.
string null $metadataSerializationFormat
One of the MDS_* constants, giving the format of the metadata as stored in the DB,...
bool $dataLoaded
Whether or not core data has been loaded from the database (loadFromXxx).
lock()
Start an atomic DB section and lock the image for update or increments a reference counter if the loc...
acquireFileLock( $timeout=0)
Acquire an exclusive lock on the file, indicating an intention to perform writes to the registry data...
bool $extraDataLoaded
Whether or not lazy-loaded data has been loaded from the database.
getThumbnails( $archiveName=false)
getTransformScript inherited
prerenderThumbnails()
Prerenders a configurable set of thumbnails.
getUploader(int $audience=self::FOR_PUBLIC, ?Authority $performer=null)
getFileIdFromName()
This is mostly for the migration period.
__construct( $title, $repo)
Do not call this except from inside a repo class.
getHistory( $limit=null, $start=null, $end=null, $inc=true)
purgeDescription inherited
getDescription( $audience=self::FOR_PUBLIC, ?Authority $performer=null)
__destruct()
Clean up any dangling locks.
move( $target)
getLinksTo inherited
recordUpload3(string $oldver, string $comment, string $pageText, Authority $performer, $props=false, $timestamp=false, $tags=[], bool $createDummyRevision=true, bool $revert=false)
Record a file upload in the upload log and the image table (version 3).
loadFromDB( $flags=0)
Load file metadata from the DB.
resetHistory()
Reset the history pointer to the first element of the history.
int $deleted
Bitfield akin to rev_deleted.
getMediaType()
Returns the type of the media in the file.
loadExtraFromDB()
Load lazy file metadata from the DB.
static newFromKey( $sha1, $repo, $timestamp=false)
Create a LocalFile from a SHA-1 key Do not call this except from inside a repo class.
purgeThumbnails( $options=[])
Delete cached transformed files for the current version only.
restore( $versions=[], $unsuppress=false)
Restore all or specified deleted revisions to the given file.
maybeUpgradeRow()
Upgrade a row if it needs it.
getCacheKey()
Get the memcached key for the main data for this file, or false if there is no access to the shared c...
releaseFileLock()
Release a lock acquired with acquireFileLock().
purgeCache( $options=[])
Delete all previously generated thumbnails, refresh metadata in memcached and purge the CDN.
purgeOldThumbnails( $archiveName)
Delete cached transformed files for an archived version only.
upload( $src, $comment, $pageText, $flags=0, $props=false, $timestamp=false, ?Authority $uploader=null, $tags=[], $createDummyRevision=true, $revert=false)
getHashPath inherited
purgeThumbList( $dir, $files)
Delete a list of thumbnails visible at urls.
upgradeRow()
Fix assorted version-related problems with the image row by reloading it from the file.
getMetadataArray()
Get unserialized handler-specific metadata.
Job for asynchronous rendering of thumbnails, e.g.
Base class for language-specific code.
Definition Language.php:65
const UploadThumbnailRenderMap
Name constant for the UploadThumbnailRenderMap setting, for use with Config\get().
const FileSchemaMigrationStage
Name constant for the FileSchemaMigrationStage setting, for use with Config\get().
static getInstance()
Returns the global default instance of the top level service locator.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44
Represents a title within MediaWiki.
Definition Title.php:69
loadFromRow( $row)
Load Title object fields from a DB row.
Definition Title.php:556
Value object representing a user's identity.
MimeMagic helper wrapper.
Class representing a non-directory file on the file system.
Definition FSFile.php:20
File backend exception for checked exceptions (e.g.
static isStoragePath( $path)
Check if a given path is a "mwstore://" path.
return[ 'config-schema-inverse'=>['default'=>['ConfigRegistry'=>['main'=> 'MediaWiki\\Config\\GlobalVarConfig::newInstance',], 'Sitename'=> 'MediaWiki', 'Server'=> false, 'CanonicalServer'=> false, 'ServerName'=> false, 'AssumeProxiesUseDefaultProtocolPorts'=> true, 'HttpsPort'=> 443, 'ForceHTTPS'=> false, 'ScriptPath'=> '/wiki', 'UsePathInfo'=> null, 'Script'=> false, 'LoadScript'=> false, 'RestPath'=> false, 'StylePath'=> false, 'LocalStylePath'=> false, 'ExtensionAssetsPath'=> false, 'ExtensionDirectory'=> null, 'StyleDirectory'=> null, 'ArticlePath'=> false, 'UploadPath'=> false, 'ImgAuthPath'=> false, 'ThumbPath'=> false, 'UploadDirectory'=> false, 'FileCacheDirectory'=> false, 'Logo'=> false, 'Logos'=> false, 'Favicon'=> '/favicon.ico', 'AppleTouchIcon'=> false, 'ReferrerPolicy'=> false, 'TmpDirectory'=> false, 'UploadBaseUrl'=> '', 'UploadStashScalerBaseUrl'=> false, 'ActionPaths'=>[], 'MainPageIsDomainRoot'=> false, 'EnableUploads'=> false, 'UploadStashMaxAge'=> 21600, 'EnableAsyncUploads'=> false, 'EnableAsyncUploadsByURL'=> false, 'EnableChunkedUploads'=> false, 'UploadMaintenance'=> false, 'IllegalFileChars'=> ':\\/\\\\', 'DeletedDirectory'=> false, 'ImgAuthDetails'=> false, 'ImgAuthUrlPathMap'=>[], 'LocalFileRepo'=>['class'=> 'MediaWiki\\FileRepo\\LocalRepo', 'name'=> 'local', 'directory'=> null, 'scriptDirUrl'=> null, 'favicon'=> null, 'url'=> null, 'hashLevels'=> null, 'thumbScriptUrl'=> null, 'transformVia404'=> null, 'deletedDir'=> null, 'deletedHashLevels'=> null, 'updateCompatibleMetadata'=> null, 'reserializeMetadata'=> null,], 'ForeignFileRepos'=>[], 'UseInstantCommons'=> false, 'UseSharedUploads'=> false, 'SharedUploadDirectory'=> null, 'SharedUploadPath'=> null, 'HashedSharedUploadDirectory'=> true, 'RepositoryBaseUrl'=> 'https:'FetchCommonsDescriptions'=> false, 'SharedUploadDBname'=> false, 'SharedUploadDBprefix'=> '', 'SharedUploadDBschema'=> null, 'CacheSharedUploads'=> true, 'ForeignUploadTargets'=>['local',], 'UploadDialog'=>['fields'=>['description'=> true, 'date'=> false, 'categories'=> false,], 'licensemessages'=>['local'=> 'generic-local', 'foreign'=> 'generic-foreign',], 'comment'=>['local'=> '', 'foreign'=> '',], 'format'=>['filepage'=> ' $DESCRIPTION', 'description'=> ' $TEXT', 'ownwork'=> '', 'license'=> '', 'uncategorized'=> '',],], 'FileBackends'=>[], 'LockManagers'=>[], 'DefaultLockManager'=> null, 'ShowEXIF'=> null, 'UpdateCompatibleMetadata'=> false, 'AllowCopyUploads'=> false, 'CopyUploadsDomains'=>[], 'CopyUploadsFromSpecialUpload'=> false, 'CopyUploadProxy'=> false, 'CopyUploadTimeout'=> false, 'CopyUploadAllowOnWikiDomainConfig'=> false, 'MaxUploadSize'=> 104857600, 'MinUploadChunkSize'=> 1024, 'UploadNavigationUrl'=> false, 'UploadMissingFileUrl'=> false, 'ThumbnailScriptPath'=> false, 'SharedThumbnailScriptPath'=> false, 'HashedUploadDirectory'=> true, 'CSPUploadEntryPoint'=> true, 'FileExtensions'=>['png', 'gif', 'jpg', 'jpeg', 'webp',], 'ProhibitedFileExtensions'=>['html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl', 'xml',], 'MimeTypeExclusions'=>['text/html', 'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript', 'application/x-php', 'text/x-php', 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh', 'text/scriptlet', 'application/x-msdownload', 'application/x-msmetafile', 'application/java', 'application/xml', 'text/xml',], 'CheckFileExtensions'=> true, 'StrictFileExtensions'=> true, 'DisableUploadScriptChecks'=> false, 'UploadSizeWarning'=> false, 'TrustedMediaFormats'=>['BITMAP', 'AUDIO', 'VIDEO', 'image/svg+xml', 'application/pdf',], 'MediaHandlers'=>[], 'NativeImageLazyLoading'=> true, 'ParserTestMediaHandlers'=>['image/jpeg'=> 'MockBitmapHandler', 'image/png'=> 'MockBitmapHandler', 'image/gif'=> 'MockBitmapHandler', 'image/tiff'=> 'MockBitmapHandler', 'image/webp'=> 'MockBitmapHandler', 'image/x-ms-bmp'=> 'MockBitmapHandler', 'image/x-bmp'=> 'MockBitmapHandler', 'image/x-xcf'=> 'MockBitmapHandler', 'image/svg+xml'=> 'MockSvgHandler', 'image/vnd.djvu'=> 'MockDjVuHandler',], 'UseImageResize'=> true, 'UseImageMagick'=> false, 'ImageMagickConvertCommand'=> '/usr/bin/convert', 'MaxInterlacingAreas'=>[], 'SharpenParameter'=> '0x0.4', 'SharpenReductionThreshold'=> 0.85, 'ImageMagickTempDir'=> false, 'CustomConvertCommand'=> false, 'JpegTran'=> '/usr/bin/jpegtran', 'JpegPixelFormat'=> 'yuv420', 'JpegQuality'=> 80, 'Exiv2Command'=> '/usr/bin/exiv2', 'Exiftool'=> '/usr/bin/exiftool', 'SVGConverters'=>['ImageMagick'=> ' $path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output', 'inkscape'=> ' $path/inkscape -w $width -o $output $input', 'batik'=> 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input', 'rsvg'=> ' $path/rsvg-convert -w $width -h $height -l $lang -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 12500000, 'MaxAnimatedWebPArea'=> 12500000, 'TiffThumbnailType'=>[], 'ThumbnailEpoch'=> '20030516000000', 'AttemptFailureEpoch'=> 1, 'IgnoreImageErrors'=> false, 'GenerateThumbnailOnParse'=> true, 'ShowArchiveThumbnails'=> true, 'EnableAutoRotation'=> null, 'Antivirus'=> null, 'AntivirusSetup'=>['clamav'=>['command'=> 'clamscan --no-summary ', 'codemap'=>[0=> 0, 1=> 1, 52=> -1, ' *'=> false,], 'messagepattern'=> '/.*?:(.*)/sim',],], 'AntivirusRequired'=> true, 'VerifyMimeType'=> true, 'MimeTypeFile'=> 'internal', 'MimeInfoFile'=> 'internal', 'MimeDetectorCommand'=> null, 'TrivialMimeDetection'=> false, 'XMLMimeTypes'=>['http:'svg'=> 'image/svg+xml', 'http:'http:'html'=> 'text/html',], 'ImageLimits'=>[[320, 240,], [640, 480,], [800, 600,], [1024, 768,], [1280, 1024,], [2560, 2048,],], 'ThumbLimits'=>[120, 150, 180, 200, 220, 250, 300, 400,], 'ThumbnailNamespaces'=>[6,], 'ThumbnailSteps'=> null, 'ThumbnailBuckets'=> null, 'ThumbnailMinimumBucketDistance'=> 50, 'UploadThumbnailRenderMap'=>[], 'UploadThumbnailRenderMethod'=> 'jobqueue', 'UploadThumbnailRenderHttpCustomHost'=> false, 'UploadThumbnailRenderHttpCustomDomain'=> false, 'UseTinyRGBForJPGThumbnails'=> false, 'GalleryOptions'=>[], 'ThumbUpright'=> 0.75, 'DirectoryMode'=> 511, 'ResponsiveImages'=> true, 'ImagePreconnect'=> false, 'TrackMediaRequestProvenance'=> false, 'DjvuUseBoxedCommand'=> false, 'DjvuDump'=> null, 'DjvuRenderer'=> null, 'DjvuTxt'=> null, 'DjvuPostProcessor'=> 'pnmtojpeg', 'DjvuOutputExtension'=> 'jpg', 'EmergencyContact'=> false, 'PasswordSender'=> false, 'NoReplyAddress'=> false, 'EnableEmail'=> true, 'EnableUserEmail'=> true, 'UserEmailUseReplyTo'=> true, 'PasswordReminderResendTime'=> 24, 'NewPasswordExpiry'=> 604800, 'UserEmailConfirmationTokenExpiry'=> 604800, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, 'EmailConfirmationBanner'=> false, 'EnotifWatchlist'=> false, 'EnotifUserTalk'=> false, 'EnotifRevealEditorAddress'=> false, 'EnotifMinorEdits'=> true, 'EnotifUseRealName'=> false, 'UsersNotifiedOnAllChanges'=>[], 'DBname'=> 'my_wiki', 'DBmwschema'=> null, 'DBprefix'=> '', 'DBserver'=> 'localhost', 'DBport'=> 5432, 'DBuser'=> 'wikiuser', 'DBpassword'=> '', 'DBtype'=> 'mysql', 'DBssl'=> false, 'DBcompress'=> false, 'DBStrictWarnings'=> false, 'DBadminuser'=> null, 'DBadminpassword'=> null, 'SearchType'=> null, 'SearchTypeAlternatives'=> null, 'DBTableOptions'=> 'ENGINE=InnoDB, DEFAULT CHARSET=binary', 'SQLMode'=> '', 'SQLiteDataDir'=> '', 'SharedDB'=> null, 'SharedPrefix'=> false, 'SharedTables'=>['user', 'user_properties', 'user_autocreate_serial',], 'SharedSchema'=> false, 'DBservers'=> false, 'LBFactoryConf'=>['class'=> 'Wikimedia\\Rdbms\\LBFactorySimple',], 'DataCenterUpdateStickTTL'=> 10, 'DBerrorLog'=> false, 'DBerrorLogTZ'=> false, 'LocalDatabases'=>[], 'DatabaseReplicaLagWarning'=> 10, 'DatabaseReplicaLagCritical'=> 30, 'MaxExecutionTimeForExpensiveQueries'=> 0, 'VirtualDomainsMapping'=>[], 'RemoteVirtualDomainsMapping'=>[], 'FileSchemaMigrationStage'=> 3, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'CodeHighlighter',],], 'text'=> 'MediaWiki\\Content\\TextContentHandler', 'unknown'=> 'MediaWiki\\Content\\FallbackContentHandler',], 'NamespaceContentModels'=>[], 'TextModelsToParse'=>['wikitext', 'javascript', 'css',], 'CompressRevisions'=> false, 'ExternalStores'=>[], 'ExternalServers'=>[], 'DefaultExternalStore'=> false, 'RevisionCacheExpiry'=> 604800, 'PageLanguageUseDB'=> false, 'DiffEngine'=> null, 'ExternalDiffEngine'=> false, 'Wikidiff2Options'=>[], 'RequestTimeLimit'=> null, 'TransactionalTimeLimit'=> 120, 'CriticalSectionTimeLimit'=> 180.0, 'MiserMode'=> false, 'DisableQueryPages'=> false, 'QueryCacheLimit'=> 1000, 'WantedPagesThreshold'=> 1, 'AllowSlowParserFunctions'=> false, 'AllowSchemaUpdates'=> true, 'MaxArticleSize'=> 2048, 'MemoryLimit'=> '50M', 'PoolCounterConf'=> null, 'PoolCountClientConf'=>['servers'=>['127.0.0.1',], 'timeout'=> 0.1,], 'MaxUserDBWriteDuration'=> false, 'MaxJobDBWriteDuration'=> false, 'LinkHolderBatchSize'=> 1000, 'MaximumMovedPages'=> 100, 'ForceDeferredUpdatesPreSend'=> false, 'MultiShardSiteStats'=> false, 'CacheDirectory'=> false, 'MainCacheType'=> 0, 'MessageCacheType'=> -1, 'ParserCacheType'=> -1, 'SessionCacheType'=> -1, 'AnonSessionCacheType'=> false, 'LanguageConverterCacheType'=> -1, 'ObjectCaches'=>[0=>['class'=> 'Wikimedia\\ObjectCache\\EmptyBagOStuff', 'reportDupes'=> false,], 1=>['class'=> 'MediaWiki\\ObjectCache\\SqlBagOStuff', 'loggroup'=> 'SQLBagOStuff',], 'memcached-php'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPhpBagOStuff', 'loggroup'=> 'memcached',], 'memcached-pecl'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPeclBagOStuff', 'loggroup'=> 'memcached',], 'hash'=>['class'=> 'Wikimedia\\ObjectCache\\HashBagOStuff', 'reportDupes'=> false,], 'apc'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,], 'apcu'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,],], 'WANObjectCache'=>[], 'MicroStashType'=> -1, 'MainStash'=> 1, 'ParsoidCacheConfig'=>['StashType'=> null, 'StashDuration'=> 86400,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'SplitParsoidParserCache'=> false, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, 'JwtSessionCookieIssuer'=> null, 'MemCachedServers'=>['127.0.0.1:11211',], 'MemCachedPersistent'=> false, 'MemCachedTimeout'=> 500000, 'UseLocalMessageCache'=> false, 'AdaptiveMessageCache'=> false, 'LocalisationCacheConf'=>['class'=> 'MediaWiki\\Language\\LocalisationCache', 'store'=> 'detect', 'storeClass'=> false, 'storeDirectory'=> false, 'storeServer'=>[], 'forceRecache'=> false, 'manualRecache'=> false,], 'CachePages'=> true, 'CacheEpoch'=> '20030516000000', 'GitInfoCacheDirectory'=> false, 'UseFileCache'=> false, 'FileCacheDepth'=> 2, 'RenderHashAppend'=> '', 'EnableSidebarCache'=> false, 'SidebarCacheExpiry'=> 86400, 'UseGzip'=> false, 'InvalidateCacheOnLocalSettingsChange'=> true, 'ExtensionInfoMTime'=> false, 'EnableRemoteBagOStuffTests'=> false, 'UseCdn'=> false, 'VaryOnXFP'=> false, 'InternalServer'=> false, 'CdnMaxAge'=> 18000, 'CdnMaxageLagged'=> 30, 'CdnMaxageStale'=> 10, 'CdnReboundPurgeDelay'=> 0, 'CdnMaxageSubstitute'=> 60, 'CdnServers'=>[], 'CdnServersNoPurge'=>[], 'HTCPRouting'=>[], 'HTCPMulticastTTL'=> 1, 'UsePrivateIPs'=> false, 'CdnMatchParameterOrder'=> true, 'LanguageCode'=> 'en', 'GrammarForms'=>[], 'InterwikiMagic'=> true, 'HideInterlanguageLinks'=> false, 'ExtraInterlanguageLinkPrefixes'=>[], 'InterlanguageLinkCodeMap'=>[], 'ExtraLanguageNames'=>[], 'ExtraLanguageCodes'=>['bh'=> 'bho', 'no'=> 'nb', 'simple'=> 'en',], 'DummyLanguageCodes'=>[], 'AllUnicodeFixes'=> false, 'LegacyEncoding'=> false, 'AmericanDates'=> false, 'TranslateNumerals'=> true, 'UseDatabaseMessages'=> true, 'MaxMsgCacheEntrySize'=> 10000, 'DisableLangConversion'=> false, 'DisableTitleConversion'=> false, 'DefaultLanguageVariant'=> false, 'UsePigLatinVariant'=> false, 'DisabledVariants'=>[], 'VariantArticlePath'=> false, 'UseXssLanguage'=> false, 'LoginLanguageSelector'=> false, 'ForceUIMsgAsContentMsg'=>[], 'RawHtmlMessages'=>[], 'Localtimezone'=> null, 'LocalTZoffset'=> null, 'OverrideUcfirstCharacters'=>[], 'MimeType'=> 'text/html', 'Html5Version'=> null, 'EditSubmitButtonLabelPublish'=> false, 'XhtmlNamespaces'=>[], 'SiteNotice'=> '', 'BrowserFormatDetection'=> 'telephone=no', 'SkinMetaTags'=>[], 'DefaultSkin'=> 'vector-2022', 'FallbackSkin'=> 'fallback', 'SkipSkins'=>[], 'DisableOutputCompression'=> false, 'FragmentMode'=>['html5', 'legacy',], 'ExternalInterwikiFragmentMode'=> 'legacy', 'FooterIcons'=>['copyright'=>['copyright'=>[],], 'poweredby'=>['mediawiki'=>['src'=> null, 'url'=> 'https:'alt'=> 'Powered by MediaWiki', 'lang'=> 'en',],],], 'EnableSectionShare'=> false, 'PageShareSkinsEnabled'=>[], 'UseCombinedLoginLink'=> false, 'Edititis'=> false, 'Send404Code'=> true, 'ShowRollbackEditCount'=> 10, 'EnableCanonicalServerLink'=> false, 'InterwikiLogoOverride'=>[], 'ResourceModules'=>[], 'ResourceModuleSkinStyles'=>[], 'ResourceLoaderSources'=>[], 'ResourceBasePath'=> null, 'ResourceLoaderMaxage'=>[], 'ResourceLoaderDebug'=> false, 'ResourceLoaderMaxQueryLength'=> false, 'ResourceLoaderValidateJS'=> true, 'ResourceLoaderEnableJSProfiler'=> false, 'ResourceLoaderStorageEnabled'=> true, 'ResourceLoaderStorageVersion'=> 1, 'ResourceLoaderEnableSourceMapLinks'=> true, 'AllowSiteCSSOnRestrictedPages'=> false, 'VueDevelopmentMode'=> false, 'CodexDevelopmentDir'=> null, 'MetaNamespace'=> false, 'MetaNamespaceTalk'=> false, 'CanonicalNamespaceNames'=>[-2=> 'Media', -1=> 'Special', 0=> '', 1=> 'Talk', 2=> 'User', 3=> 'User_talk', 4=> 'Project', 5=> 'Project_talk', 6=> 'File', 7=> 'File_talk', 8=> 'MediaWiki', 9=> 'MediaWiki_talk', 10=> 'Template', 11=> 'Template_talk', 12=> 'Help', 13=> 'Help_talk', 14=> 'Category', 15=> 'Category_talk',], 'ExtraNamespaces'=>[], 'ExtraGenderNamespaces'=>[], 'NamespaceAliases'=>[], 'LegalTitleChars'=> ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', 'CapitalLinks' => true, 'CapitalLinkOverrides' => [ ], 'NamespacesWithSubpages' => [ 1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 7 => true, 8 => true, 9 => true, 10 => true, 11 => true, 12 => true, 13 => true, 15 => true, ], 'NamespacesWithoutAutoSummaries' => [ ], 'ContentNamespaces' => [ 0, ], 'ShortPagesNamespaceExclusions' => [ ], 'ExtraSignatureNamespaces' => [ ], 'InvalidRedirectTargets' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog', ], 'DisableHardRedirects' => false, 'FixDoubleRedirects' => false, 'LocalInterwikis' => [ ], 'InterwikiExpiry' => 10800, 'InterwikiCache' => false, 'InterwikiScopes' => 3, 'InterwikiFallbackSite' => 'wiki', 'RedirectSources' => false, 'SiteTypes' => [ 'mediawiki' => 'MediaWiki\\Site\\MediaWikiSite', ], 'MaxTocLevel' => 999, 'MaxPPNodeCount' => 1000000, 'MaxTemplateDepth' => 100, 'MaxPPExpandDepth' => 100, 'UrlProtocols' => [ 'bitcoin:', 'ftp: 'ftps: 'geo:', 'git: 'gopher: 'http: 'https: 'irc: 'ircs: 'magnet:', 'mailto:', 'matrix:', 'mms: 'news:', 'nntp: 'redis: 'sftp: 'sip:', 'sips:', 'sms:', 'ssh: 'svn: 'tel:', 'telnet: 'urn:', 'wikipedia: 'worldwind: 'xmpp:', ' ], 'CleanSignatures' => true, 'AllowExternalImages' => false, 'AllowExternalImagesFrom' => '', 'EnableImageWhitelist' => false, 'TidyConfig' => [ ], 'ParsoidSettings' => [ 'useSelser' => true, ], 'ParsoidExperimentalParserFunctionOutput' => false, 'RawHtml' => false, 'ExternalLinkTarget' => false, 'NoFollowLinks' => true, 'NoFollowNsExceptions' => [ ], 'NoFollowDomainExceptions' => [ 'mediawiki.org', ], 'RegisterInternalExternals' => false, 'ExternalLinksIgnoreDomains' => [ ], 'AllowDisplayTitle' => true, 'RestrictDisplayTitle' => true, 'ExpensiveParserFunctionLimit' => 100, 'PreprocessorCacheThreshold' => 1000, 'EnableScaryTranscluding' => false, 'TranscludeCacheExpiry' => 3600, 'EnableMagicLinks' => [ 'ISBN' => false, 'PMID' => false, 'RFC' => false, ], 'ParserEnableUserLanguage' => false, 'ArticleCountMethod' => 'link', 'ActiveUserDays' => 30, 'LearnerEdits' => 10, 'LearnerMemberSince' => 4, 'ExperiencedUserEdits' => 500, 'ExperiencedUserMemberSince' => 30, 'ManualRevertSearchRadius' => 15, 'RevertedTagMaxDepth' => 15, 'CentralIdLookupProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\CentralId\\LocalIdLookup', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', 'HideUserUtils', ], ], ], 'CentralIdLookupProvider' => 'local', 'UserRegistrationProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\Registration\\LocalUserRegistrationProvider', 'services' => [ 'ConnectionProvider', ], ], ], 'PasswordPolicy' => [ 'policies' => [ 'bureaucrat' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'sysop' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'interface-admin' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'bot' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'default' => [ 'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true, ], 'PasswordCannotBeSubstringInUsername' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true, ], 'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], ], ], 'checks' => [ 'MinimalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimalPasswordLength', ], 'MinimumPasswordLengthToLogin' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimumPasswordLengthToLogin', ], 'PasswordCannotBeSubstringInUsername' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotBeSubstringInUsername', ], 'PasswordCannotMatchDefaults' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotMatchDefaults', ], 'MaximalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMaximalPasswordLength', ], 'PasswordNotInCommonList' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordNotInCommonList', ], ], ], 'AuthManagerConfig' => null, 'AuthManagerAutoConfig' => [ 'preauth' => [ 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider', 'services' => [ 'ConnectionProvider', 'UserFactory', ], 'sort' => 0, ], ], 'primaryauth' => [ 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', 'UserOptionsLookup', ], 'args' => [ [ 'authoritative' => false, ], ], 'sort' => 0, ], 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'args' => [ [ 'authoritative' => true, ], ], 'sort' => 100, ], ], 'secondaryauth' => [ 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider', 'sort' => 100, ], 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'sort' => 200, ], ], ], 'RememberMe' => 'choose', 'ReauthenticateTime' => [ 'default' => 3600, ], 'ChangeCredentialsBlacklist' => [ 'MediaWiki\\Auth\\TemporaryPasswordAuthenticationRequest', ], 'RemoveCredentialsBlacklist' => [ 'MediaWiki\\Auth\\PasswordAuthenticationRequest', ], 'InvalidPasswordReset' => true, 'PasswordDefault' => 'pbkdf2', 'PasswordConfig' => [ 'A' => [ 'class' => 'MediaWiki\\Password\\MWOldPassword', ], 'B' => [ 'class' => 'MediaWiki\\Password\\MWSaltedPassword', ], 'pbkdf2-legacyA' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'A', 'pbkdf2', ], ], 'pbkdf2-legacyB' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'B', 'pbkdf2', ], ], 'bcrypt' => [ 'class' => 'MediaWiki\\Password\\BcryptPassword', 'cost' => 9, ], 'pbkdf2' => [ 'class' => 'MediaWiki\\Password\\Pbkdf2PasswordUsingOpenSSL', 'algo' => 'sha512', 'cost' => '30000', 'length' => '64', ], 'argon2' => [ 'class' => 'MediaWiki\\Password\\Argon2Password', 'algo' => 'auto', ], ], 'PasswordResetRoutes' => [ 'username' => true, 'email' => true, ], 'MaxSigChars' => 255, 'SignatureValidation' => 'warning', 'SignatureAllowedLintErrors' => [ 'obsolete-tag', ], 'MaxNameChars' => 255, 'ReservedUsernames' => [ 'MediaWiki default', 'Conversion script', 'Maintenance script', 'Template namespace initialisation script', 'ScriptImporter', 'Delete page script', 'Move page script', 'Command line script', 'Unknown user', 'msg:double-redirect-fixer', 'msg:usermessage-editor', 'msg:proxyblocker', 'msg:sorbs', 'msg:spambot_username', 'msg:autochange-username', ], 'DefaultUserOptions' => [ 'ccmeonemails' => 0, 'date' => 'default', 'diffonly' => 0, 'diff-type' => 'table', 'disablemail' => 0, 'editfont' => 'monospace', 'editondblclick' => 0, 'editrecovery' => 0, 'editsectiononrightclick' => 0, 'email-allow-new-users' => 1, 'enotifminoredits' => 0, 'enotifrevealaddr' => 0, 'enotifusertalkpages' => 1, 'enotifwatchlistpages' => 1, 'extendwatchlist' => 1, 'fancysig' => 0, 'forceeditsummary' => 0, 'forcesafemode' => 0, 'gender' => 'unknown', 'hidecategorization' => 1, 'hideminor' => 0, 'hidepatrolled' => 0, 'imagesize' => 2, 'minordefault' => 0, 'newpageshidepatrolled' => 0, 'nickname' => '', 'norollbackdiff' => 0, 'prefershttps' => 1, 'previewonfirst' => 0, 'previewontop' => 1, 'pst-cssjs' => 1, 'rcdays' => 7, 'rcenhancedfilters-disable' => 0, 'rclimit' => 50, 'requireemail' => 0, 'search-match-redirect' => true, 'search-special-page' => 'Search', 'search-thumbnail-extra-namespaces' => true, 'searchlimit' => 20, 'showhiddencats' => 0, 'shownumberswatching' => 1, 'showrollbackconfirmation' => 0, 'skin' => false, 'skin-responsive' => 1, 'thumbsize' => 5, 'underline' => 2, 'useeditwarning' => 1, 'uselivepreview' => 0, 'usenewrc' => 1, 'watchcreations' => 1, 'watchcreations-expiry' => 'infinite', 'watchdefault' => 1, 'watchdefault-expiry' => 'infinite', 'watchdeletion' => 0, 'watchlistdays' => 7, 'watchlisthideanons' => 0, 'watchlisthidebots' => 0, 'watchlisthidecategorization' => 1, 'watchlisthideliu' => 0, 'watchlisthideminor' => 0, 'watchlisthideown' => 0, 'watchlisthidepatrolled' => 0, 'watchlistreloadautomatically' => 0, 'watchlistunwatchlinks' => 0, 'watchmoves' => 0, 'watchrollback' => 0, 'watchuploads' => 1, 'watchrollback-expiry' => 'infinite', 'watchstar-expiry' => 'infinite', 'wlenhancedfilters-disable' => 0, 'wllimit' => 250, ], 'ConditionalUserOptions' => [ ], 'HiddenPrefs' => [ ], 'UserJsPrefLimit' => 100, 'InvalidUsernameCharacters' => '@:>=', 'UserrightsInterwikiDelimiter' => '@', 'SecureLogin' => false, 'AuthenticationTokenVersion' => null, 'SessionProviders' => [ 'MediaWiki\\Session\\CookieSessionProvider' => [ 'class' => 'MediaWiki\\Session\\CookieSessionProvider', 'args' => [ [ 'priority' => 30, ], ], 'services' => [ 'JwtCodec', 'UrlUtils', ], ], 'MediaWiki\\Session\\BotPasswordSessionProvider' => [ 'class' => 'MediaWiki\\Session\\BotPasswordSessionProvider', 'args' => [ [ 'priority' => 75, ], ], 'services' => [ 'GrantsInfo', ], ], ], 'AutoCreateTempUser' => [ 'known' => false, 'enabled' => false, 'actions' => [ 'edit', ], 'genPattern' => '~$1', 'matchPattern' => null, 'reservedPattern' => '~$1', 'serialProvider' => [ 'type' => 'local', 'useYear' => true, ], 'serialMapping' => [ 'type' => 'readable-numeric', ], 'expireAfterDays' => 90, 'notifyBeforeExpirationDays' => 10, ], 'AutoblockExemptions' => [ ], 'AutoblockExpiry' => 86400, 'BlockAllowsUTEdit' => true, 'BlockCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 19, ], 'BlockDisablesLogin' => false, 'EnableMultiBlocks' => false, 'WhitelistRead' => false, 'WhitelistReadRegexp' => false, 'EmailConfirmToEdit' => false, 'HideIdentifiableRedirects' => true, 'GroupPermissions' => [ '*' => [ 'createaccount' => true, 'autocreateaccount' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'viewmyprivateinfo' => true, 'editmyprivateinfo' => true, 'editmyoptions' => true, ], 'user' => [ 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'movefile' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'minoredit' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, 'editmyuserjsredirect' => true, 'sendemail' => true, 'applychangetags' => true, 'changetags' => true, 'viewmywatchlist' => true, 'editmywatchlist' => true, 'createwithcontentmodel' => true, 'logout' => true, ], 'autoconfirmed' => [ 'autoconfirmed' => true, 'editsemiprotected' => true, ], 'bot' => [ 'bot' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'nominornewtalk' => true, 'autopatrol' => true, 'suppressredirect' => true, 'apihighlimits' => true, ], 'sysop' => [ 'block' => true, 'createaccount' => true, 'createpreviouslyrenamedaccount' => true, 'delete' => true, 'bigdelete' => true, 'deletedhistory' => true, 'deletedtext' => true, 'undelete' => true, 'editcontentmodel' => true, 'editinterface' => true, 'editsitejson' => true, 'edituserjson' => true, 'import' => true, 'importupload' => true, 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'patrol' => true, 'autopatrol' => true, 'protect' => true, 'editprotected' => true, 'rollback' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'unwatchedpages' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'blockemail' => true, 'markbotedits' => true, 'apihighlimits' => true, 'browsearchive' => true, 'noratelimit' => true, 'movefile' => true, 'unblockself' => true, 'suppressredirect' => true, 'mergehistory' => true, 'managechangetags' => true, 'deletechangetags' => true, ], 'interface-admin' => [ 'editinterface' => true, 'editsitecss' => true, 'editsitejson' => true, 'editsitejs' => true, 'editusercss' => true, 'edituserjson' => true, 'edituserjs' => true, ], 'bureaucrat' => [ 'userrights' => true, 'noratelimit' => true, 'renameuser' => true, ], 'suppress' => [ 'hideuser' => true, 'suppressrevision' => true, 'viewsuppressed' => true, 'suppressionlog' => true, 'deleterevision' => true, 'deletelogentry' => true, ], ], 'PrivilegedGroups' => [ 'bureaucrat', 'interface-admin', 'suppress', 'sysop', ], 'RevokePermissions' => [ ], 'GroupInheritsPermissions' => [ ], 'ImplicitGroups' => [ '*', 'user', 'autoconfirmed', ], 'GroupsAddToSelf' => [ ], 'GroupsRemoveFromSelf' => [ ], 'RestrictedGroups' => [ ], 'UserRequirementsPrivateConditions' => [ ], 'RestrictionTypes' => [ 'create', 'edit', 'move', 'upload', ], 'RestrictionLevels' => [ '', 'autoconfirmed', 'sysop', ], 'CascadingRestrictionLevels' => [ 'sysop', ], 'SemiprotectedRestrictionLevels' => [ 'autoconfirmed', ], 'NamespaceProtection' => [ ], 'RestrictUserPageEditing' => false, 'NonincludableNamespaces' => [ ], 'AutoConfirmAge' => 0, 'AutoConfirmCount' => 0, 'Autopromote' => [ 'autoconfirmed' => [ '&', [ 1, null, ], [ 2, null, ], ], ], 'AutopromoteOnce' => [ 'onEdit' => [ ], ], 'AutopromoteOnceLogInRC' => true, 'AutopromoteOnceRCExcludedGroups' => [ ], 'AddGroups' => [ ], 'RemoveGroups' => [ ], 'AvailableRights' => [ ], 'ImplicitRights' => [ ], 'DeleteRevisionsLimit' => 0, 'DeleteRevisionsBatchSize' => 1000, 'HideUserContribLimit' => 1000, 'AccountCreationThrottle' => [ [ 'count' => 0, 'seconds' => 86400, ], ], 'TempAccountCreationThrottle' => [ [ 'count' => 1, 'seconds' => 600, ], [ 'count' => 6, 'seconds' => 86400, ], ], 'TempAccountNameAcquisitionThrottle' => [ [ 'count' => 60, 'seconds' => 86400, ], ], 'SpamRegex' => [ ], 'SummarySpamRegex' => [ ], 'EnableDnsBlacklist' => false, 'DnsBlacklistUrls' => [ ], 'ProxyList' => [ ], 'ProxyWhitelist' => [ ], 'SoftBlockRanges' => [ ], 'ApplyIpBlocksToXff' => false, 'RateLimits' => [ 'edit' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], 'user' => [ 90, 60, ], ], 'move' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], 'upload' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'rollback' => [ 'user' => [ 10, 60, ], 'newbie' => [ 5, 120, ], ], 'mailpassword' => [ 'ip' => [ 5, 3600, ], ], 'sendemail' => [ 'ip' => [ 5, 86400, ], 'newbie' => [ 5, 86400, ], 'user' => [ 20, 86400, ], ], 'changeemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'confirmemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'purge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'linkpurge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'renderfile' => [ 'ip' => [ 700, 30, ], 'user' => [ 700, 30, ], ], 'renderfile-nonstandard' => [ 'ip' => [ 70, 30, ], 'user' => [ 70, 30, ], ], 'stashedit' => [ 'ip' => [ 30, 60, ], 'newbie' => [ 30, 60, ], ], 'stashbasehtml' => [ 'ip' => [ 5, 60, ], 'newbie' => [ 5, 60, ], ], 'changetags' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'editcontentmodel' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], ], 'RateLimitsExcludedIPs' => [ ], 'PutIPinRC' => true, 'QueryPageDefaultLimit' => 50, 'ExternalQuerySources' => [ ], 'PasswordAttemptThrottle' => [ [ 'count' => 5, 'seconds' => 300, ], [ 'count' => 150, 'seconds' => 172800, ], ], 'GrantPermissions' => [ 'basic' => [ 'autocreateaccount' => true, 'autoconfirmed' => true, 'autopatrol' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'nominornewtalk' => true, 'patrolmarks' => true, 'read' => true, 'unwatchedpages' => true, ], 'highvolume' => [ 'bot' => true, 'apihighlimits' => true, 'noratelimit' => true, 'markbotedits' => true, ], 'import' => [ 'import' => true, 'importupload' => true, ], 'editpage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, 'editusercss' => true, 'edituserjs' => true, 'editsitecss' => true, 'editsitejs' => true, ], 'createeditmovepage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'createpage' => true, 'createtalk' => true, 'delete-redirect' => true, 'move' => true, 'move-rootuserpages' => true, 'move-subpages' => true, 'move-categorypages' => true, 'suppressredirect' => true, ], 'uploadfile' => [ 'upload' => true, 'reupload-own' => true, ], 'uploadeditmovefile' => [ 'upload' => true, 'reupload-own' => true, 'reupload' => true, 'reupload-shared' => true, 'upload_by_url' => true, 'movefile' => true, 'suppressredirect' => true, ], 'patrol' => [ 'patrol' => true, ], 'rollback' => [ 'rollback' => true, ], 'blockusers' => [ 'block' => true, 'blockemail' => true, ], 'viewdeleted' => [ 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, ], 'viewrestrictedlogs' => [ 'suppressionlog' => true, ], 'delete' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, 'delete' => true, 'bigdelete' => true, 'deletelogentry' => true, 'deleterevision' => true, 'undelete' => true, ], 'oversight' => [ 'suppressrevision' => true, 'viewsuppressed' => true, ], 'protect' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => true, ], 'managesessions' => [ 'logout' => true, ], ], 'GrantPermissionGroups' => [ 'basic' => 'hidden', 'editpage' => 'page-interaction', 'createeditmovepage' => 'page-interaction', 'editprotected' => 'page-interaction', 'patrol' => 'page-interaction', 'uploadfile' => 'file-interaction', 'uploadeditmovefile' => 'file-interaction', 'sendemail' => 'email', 'viewmywatchlist' => 'watchlist-interaction', 'editmywatchlist' => 'watchlist-interaction', 'editmycssjs' => 'customization', 'editmyoptions' => 'customization', 'editinterface' => 'administration', 'editsiteconfig' => 'administration', 'rollback' => 'administration', 'blockusers' => 'administration', 'delete' => 'administration', 'viewdeleted' => 'administration', 'viewrestrictedlogs' => 'administration', 'protect' => 'administration', 'oversight' => 'administration', 'createaccount' => 'administration', 'mergehistory' => 'administration', 'import' => 'administration', 'highvolume' => 'high-volume', 'privateinfo' => 'private-information', 'managesessions' => 'private-information', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editmywatchlist' => 'low', 'editmycssjs' => 'security', 'editmyoptions' => 'security', 'editinterface' => 'vandalism', 'editsiteconfig' => 'security', 'rollback' => 'low', 'blockusers' => 'vandalism', 'delete' => 'vandalism', 'viewdeleted' => 'vandalism', 'viewrestrictedlogs' => 'security', 'protect' => 'vandalism', 'oversight' => 'security', 'createaccount' => 'low', 'mergehistory' => 'vandalism', 'import' => 'security', 'highvolume' => 'low', 'privateinfo' => 'low', 'managesessions' => 'low', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'BotPasswordsLimit' => 100, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'ReauthenticateForActions' => [ 'edituserjs' => 'edituserjscss', 'editusercss' => 'edituserjscss', 'editsitejs' => 'editsitejscss', 'editsitecss' => 'editsitejscss', ], 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => false, 'CSPUseReportURIDirective' => false, 'CSPFalsePositiveUrls' => [ 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'chrome-extension' => true, ], 'AllowCrossOrigin' => false, 'RestAllowCrossOriginCookieAuth' => false, 'SessionSecret' => false, 'CookieExpiration' => 2592000, 'ExtendedLoginCookieExpiration' => 15552000, 'SessionCookieJwtExpiration' => 14400, 'CookieDomain' => '', 'CookiePath' => '/', 'CookieSecure' => 'detect', 'CookiePrefix' => false, 'CookieHttpOnly' => true, 'CookieSameSite' => null, 'CacheVaryCookies' => [ ], 'SessionName' => false, 'CookieSetOnAutoblock' => true, 'CookieSetOnIpBlock' => true, 'DeviceBoundSessions' => false, 'DeviceBoundSessionsReportOnly' => true, 'DeviceBoundSessionCookieName' => '__Host-dbsc', 'DeviceBoundSessionCredentialTTL' => 600, 'DeviceBoundSessionChallengeTTL' => 900, 'DeviceBoundSessionBindingTTL' => 2592000, 'DeviceBoundSessionScopeExcludes' => [ ], 'DebugLogFile' => '', 'DebugLogPrefix' => '', 'DebugRedirects' => false, 'DebugRawPage' => false, 'DebugComments' => false, 'DebugDumpSql' => false, 'TrxProfilerLimits' => [ 'GET' => [ 'masterConns' => 0, 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'POST-nonwrite' => [ 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'PostSend-GET' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 10000, 'maxAffected' => 1000, 'masterConns' => 0, 'writes' => 0, ], 'PostSend-POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'JobRunner' => [ 'readQueryTime' => 30, 'writeQueryTime' => 5, 'readQueryRows' => 100000, 'maxAffected' => 500, ], 'Maintenance' => [ 'writeQueryTime' => 5, 'maxAffected' => 1000, ], ], 'DebugLogGroups' => [ ], 'MWLoggerDefaultSpi' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ], 'ShowDebug' => false, 'SpecialVersionShowHooks' => false, 'ShowExceptionDetails' => false, 'LogExceptionBacktrace' => true, 'PropagateErrors' => true, 'ShowHostnames' => false, 'OverrideHostname' => false, 'DevelopmentWarnings' => false, 'DeprecationReleaseLimit' => false, 'Profiler' => [ ], 'StatsTarget' => null, 'StatsFormat' => null, 'StatsPrefix' => 'mediawiki', 'OpenTelemetryConfig' => null, 'PageInfoTransclusionLimit' => 50, 'EnableJavaScriptTest' => false, 'DebugToolbar' => false, 'ApiClientErrorSampleRate' => 1.0, 'DisableTextSearch' => false, 'AdvancedSearchHighlighting' => false, 'SearchHighlightBoundaries' => '[\\p{Z}\\p{P}\\p{C}]', 'OpenSearchTemplates' => [ 'application/x-suggestions+json' => false, 'application/x-suggestions+xml' => false, ], 'OpenSearchDefaultLimit' => 10, 'OpenSearchDescriptionLength' => 100, 'SearchSuggestCacheExpiry' => 1200, 'DisableSearchUpdate' => false, 'NamespacesToBeSearchedDefault' => [ true, ], 'DisableInternalSearch' => false, 'SearchForwardUrl' => null, 'SitemapNamespaces' => false, 'SitemapNamespacesPriorities' => false, 'SitemapApiConfig' => [ ], 'SpecialSearchFormOptions' => [ ], 'SearchMatchRedirectPreference' => false, 'SearchRunSuggestedQuery' => true, 'Diff3' => '/usr/bin/diff3', 'Diff' => '/usr/bin/diff', 'PreviewOnOpenNamespaces' => [ 14 => true, ], 'UniversalEditButton' => true, 'UseAutomaticEditSummaries' => true, 'CommandLineDarkBg' => false, 'ReadOnly' => null, 'ReadOnlyWatchedItemStore' => false, 'ReadOnlyFile' => false, 'UpgradeKey' => false, 'GitBin' => '/usr/bin/git', 'GitRepositoryViewers' => [ 'https: 'ssh: 'https: 'git@github\\.com:(.*?)(\\.git)?' => 'https: ], 'InstallerInitialPages' => [ [ 'titlemsg' => 'mainpage', 'text' => '{{subst:int:mainpagetext}}{{subst:int:mainpagedocfooter}}', ], ], 'RCMaxAge' => 7776000, 'WatchersMaxAge' => 15552000, 'UnwatchedPageSecret' => 1, 'RCFilterByAge' => false, 'RCLinkLimits' => [ 50, 100, 250, 500, ], 'RCLinkDays' => [ 1, 3, 7, 14, 30, ], 'RCFeeds' => [ ], 'RCWatchCategoryMembership' => false, 'UseRCPatrol' => true, 'StructuredChangeFiltersLiveUpdatePollingRate' => 3, 'UseNPPatrol' => true, 'UseFilePatrol' => true, 'Feed' => true, 'FeedLimit' => 50, 'FeedCacheTimeout' => 60, 'FeedDiffCutoff' => 32768, 'OverrideSiteFeed' => [ ], 'FeedClasses' => [ 'rss' => 'MediaWiki\\Feed\\RSSFeed', 'atom' => 'MediaWiki\\Feed\\AtomFeed', ], 'AdvertisedFeedTypes' => [ 'atom', ], 'RCShowWatchingUsers' => false, 'RCShowChangedSize' => true, 'RCChangedSizeThreshold' => 500, 'ShowUpdatedMarker' => true, 'DisableAnonTalk' => false, 'UseTagFilter' => true, 'SoftwareTags' => [ 'mw-contentmodelchange' => true, 'mw-new-redirect' => true, 'mw-removed-redirect' => true, 'mw-changed-redirect-target' => true, 'mw-blank' => true, 'mw-replace' => true, 'mw-recreated' => true, 'mw-rollback' => true, 'mw-undo' => true, 'mw-manual-revert' => true, 'mw-reverted' => true, 'mw-server-side-upload' => true, 'mw-ipblock-appeal' => true, 'mw-edited-other-users-js' => true, 'mw-edited-other-users-css' => true, ], 'RestrictedTagViewRights' => [ ], 'UnwatchedPageThreshold' => false, 'RecentChangesFlags' => [ 'newpage' => [ 'letter' => 'newpageletter', 'title' => 'recentchanges-label-newpage', 'legend' => 'recentchanges-legend-newpage', 'grouping' => 'any', ], 'minor' => [ 'letter' => 'minoreditletter', 'title' => 'recentchanges-label-minor', 'legend' => 'recentchanges-legend-minor', 'class' => 'minoredit', 'grouping' => 'all', ], 'bot' => [ 'letter' => 'boteditletter', 'title' => 'recentchanges-label-bot', 'legend' => 'recentchanges-legend-bot', 'class' => 'botedit', 'grouping' => 'all', ], 'unpatrolled' => [ 'letter' => 'unpatrolledletter', 'title' => 'recentchanges-label-unpatrolled', 'legend' => 'recentchanges-legend-unpatrolled', 'grouping' => 'any', ], ], 'WatchlistExpiry' => false, 'EnableWatchstarPopover' => false, 'EnableWatchlistLabels' => false, 'WatchlistLabelsMaxPerUser' => 100, 'WatchlistPurgeRate' => 0.1, 'WatchlistExpiryMaxDuration' => '1 year', 'EnableChangesListQueryPartitioning' => false, 'RightsPage' => null, 'RightsUrl' => null, 'RightsText' => null, 'RightsIcon' => null, 'UseCopyrightUpload' => false, 'MaxCredits' => 0, 'ShowCreditsIfMax' => true, 'ImportSources' => [ ], 'ImportTargetNamespace' => null, 'ExportAllowHistory' => true, 'ExportMaxHistory' => 0, 'ExportAllowListContributors' => false, 'ExportMaxLinkDepth' => 0, 'ExportFromNamespaces' => false, 'ExportAllowAll' => false, 'ExportPagelistLimit' => 5000, 'XmlDumpSchemaVersion' => '0.11', 'WikiFarmSettingsDirectory' => null, 'WikiFarmSettingsExtension' => 'yaml', 'ExtensionFunctions' => [ ], 'ExtensionMessagesFiles' => [ ], 'MessagesDirs' => [ ], 'TranslationAliasesDirs' => [ ], 'ExtensionEntryPointListFiles' => [ ], 'EnableParserLimitReporting' => true, 'ValidSkinNames' => [ ], 'SpecialPages' => [ ], 'ExtensionCredits' => [ ], 'Hooks' => [ ], 'ServiceWiringFiles' => [ ], 'JobClasses' => [ 'deletePage' => 'MediaWiki\\Page\\DeletePageJob', 'refreshLinks' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'deleteLinks' => 'MediaWiki\\Page\\DeleteLinksJob', 'htmlCacheUpdate' => 'MediaWiki\\JobQueue\\Jobs\\HTMLCacheUpdateJob', 'sendMail' => [ 'class' => 'MediaWiki\\Mail\\EmaillingJob', 'services' => [ 'Emailer', ], ], 'enotifNotify' => [ 'class' => 'MediaWiki\\RecentChanges\\RecentChangeNotifyJob', 'services' => [ 'RecentChangeLookup', ], ], 'fixDoubleRedirect' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\DoubleRedirectJob', 'services' => [ 'RevisionLookup', 'MagicWordFactory', 'WikiPageFactory', ], 'needsPage' => true, ], 'AssembleUploadChunks' => 'MediaWiki\\JobQueue\\Jobs\\AssembleUploadChunksJob', 'PublishStashedFile' => 'MediaWiki\\JobQueue\\Jobs\\PublishStashedFileJob', 'ThumbnailRender' => 'MediaWiki\\JobQueue\\Jobs\\ThumbnailRenderJob', 'UploadFromUrl' => 'MediaWiki\\JobQueue\\Jobs\\UploadFromUrlJob', 'recentChangesUpdate' => 'MediaWiki\\RecentChanges\\RecentChangesUpdateJob', 'refreshLinksPrioritized' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'refreshLinksDynamic' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'activityUpdateJob' => 'MediaWiki\\Watchlist\\ActivityUpdateJob', 'categoryMembershipChange' => [ 'class' => 'MediaWiki\\RecentChanges\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => [ 'class' => 'MediaWiki\\Watchlist\\WatchlistExpiryJob', 'needsPage' => false, ], 'cdnPurge' => 'MediaWiki\\JobQueue\\Jobs\\CdnPurgeJob', 'userGroupExpiry' => 'MediaWiki\\User\\UserGroupExpiryJob', 'clearWatchlistNotifications' => 'MediaWiki\\Watchlist\\ClearWatchlistNotificationsJob', 'userOptionsUpdate' => 'MediaWiki\\User\\Options\\UserOptionsUpdateJob', 'revertedTagUpdate' => 'MediaWiki\\JobQueue\\Jobs\\RevertedTagUpdateJob', 'null' => 'MediaWiki\\JobQueue\\Jobs\\NullJob', 'userEditCountInit' => 'MediaWiki\\User\\UserEditCountInitJob', 'renameUserTable' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], 'renameUserDerived' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserDerivedJob', 'services' => [ 'RenameUserFactory', 'UserFactory', ], ], 'renameUser' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], ], 'JobTypesExcludedFromDefaultQueue' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl', ], 'JobBackoffThrottling' => [ ], 'JobTypeConf' => [ 'default' => [ 'class' => 'MediaWiki\\JobQueue\\JobQueueDB', 'order' => 'random', 'claimTTL' => 3600, ], ], 'JobQueueIncludeInMaxLagFactor' => false, 'SpecialPageCacheUpdates' => [ 'Statistics' => [ 'MediaWiki\\Deferred\\SiteStatsUpdate', 'cacheUpdate', ], ], 'PagePropLinkInvalidations' => [ 'hiddencat' => 'categorylinks', ], 'CategoryMagicGallery' => true, 'CategoryPagingLimit' => 200, 'CategoryCollation' => 'uppercase', 'TempCategoryCollations' => [ ], 'SortedCategories' => false, 'TrackingCategories' => [ ], 'LogTypes' => [ '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'import', 'interwiki', 'patrol', 'merge', 'suppress', 'tag', 'managetags', 'contentmodel', 'renameuser', ], 'LogRestrictions' => [ 'suppress' => 'suppressionlog', ], 'FilterLogTypes' => [ 'patrol' => true, 'tag' => true, 'newusers' => false, ], 'LogNames' => [ '' => 'all-logs-page', 'block' => 'blocklogpage', 'protect' => 'protectlogpage', 'rights' => 'rightslog', 'delete' => 'dellogpage', 'upload' => 'uploadlogpage', 'move' => 'movelogpage', 'import' => 'importlogpage', 'patrol' => 'patrol-log-page', 'merge' => 'mergelog', 'suppress' => 'suppressionlog', ], 'LogHeaders' => [ '' => 'alllogstext', 'block' => 'blocklogtext', 'delete' => 'dellogpagetext', 'import' => 'importlogpagetext', 'merge' => 'mergelogpagetext', 'move' => 'movelogpagetext', 'patrol' => 'patrol-log-header', 'protect' => 'protectlogtext', 'rights' => 'rightslogtext', 'suppress' => 'suppressionlogtext', 'upload' => 'uploadlogpagetext', ], 'LogActions' => [ ], 'LogActionsHandlers' => [ 'block/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/unblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'contentmodel/change' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'contentmodel/new' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'delete/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir2' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/restore' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'import/interwiki' => 'MediaWiki\\Logging\\ImportLogFormatter', 'import/upload' => 'MediaWiki\\Logging\\ImportLogFormatter', 'interwiki/iw_add' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_delete' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_edit' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'managetags/activate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/create' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/deactivate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/delete' => 'MediaWiki\\Logging\\LogFormatter', 'merge/merge' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'merge/merge-into' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move_redir' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'patrol/patrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'patrol/autopatrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'protect/modify' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/move_prot' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/protect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/unprotect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'renameuser/renameuser' => [ 'class' => 'MediaWiki\\Logging\\RenameuserLogFormatter', 'services' => [ 'TitleParser', ], ], 'rights/autopromote' => 'MediaWiki\\Logging\\RightsLogFormatter', 'rights/rights' => 'MediaWiki\\Logging\\RightsLogFormatter', 'suppress/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'tag/update' => 'MediaWiki\\Logging\\TagLogFormatter', 'upload/overwrite' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/revert' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/upload' => 'MediaWiki\\Logging\\UploadLogFormatter', ], 'ActionFilteredLogs' => [ 'block' => [ 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], 'unblock' => [ 'unblock', ], ], 'contentmodel' => [ 'change' => [ 'change', ], 'new' => [ 'new', ], ], 'delete' => [ 'delete' => [ 'delete', ], 'delete_redir' => [ 'delete_redir', 'delete_redir2', ], 'restore' => [ 'restore', ], 'event' => [ 'event', ], 'revision' => [ 'revision', ], ], 'import' => [ 'interwiki' => [ 'interwiki', ], 'upload' => [ 'upload', ], ], 'managetags' => [ 'create' => [ 'create', ], 'delete' => [ 'delete', ], 'activate' => [ 'activate', ], 'deactivate' => [ 'deactivate', ], ], 'move' => [ 'move' => [ 'move', ], 'move_redir' => [ 'move_redir', ], ], 'newusers' => [ 'create' => [ 'create', 'newusers', ], 'create2' => [ 'create2', ], 'autocreate' => [ 'autocreate', ], 'byemail' => [ 'byemail', ], ], 'protect' => [ 'protect' => [ 'protect', ], 'modify' => [ 'modify', ], 'unprotect' => [ 'unprotect', ], 'move_prot' => [ 'move_prot', ], ], 'rights' => [ 'rights' => [ 'rights', ], 'autopromote' => [ 'autopromote', ], ], 'suppress' => [ 'event' => [ 'event', ], 'revision' => [ 'revision', ], 'delete' => [ 'delete', ], 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], ], 'upload' => [ 'upload' => [ 'upload', ], 'overwrite' => [ 'overwrite', ], 'revert' => [ 'revert', ], ], ], 'NewUserLog' => true, 'WatchUserPageOnAccountCreation' => true, 'PageCreationLog' => true, 'AllowSpecialInclusion' => true, 'DisableQueryPageUpdate' => false, 'CountCategorizedImagesAsUsed' => false, 'MaxRedirectLinksRetrieved' => 500, 'RangeContributionsCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 32, ], 'Actions' => [ ], 'DefaultRobotPolicy' => 'index,follow', 'NamespaceRobotPolicies' => [ ], 'ArticleRobotPolicies' => [ ], 'ExemptFromUserRobotsControl' => null, 'DebugAPI' => false, 'APIModules' => [ ], 'APIFormatModules' => [ ], 'APIMetaModules' => [ ], 'APIPropModules' => [ ], 'APIListModules' => [ ], 'APIMaxDBRows' => 5000, 'APIMaxResultSize' => 8388608, 'APIMaxUncachedDiffs' => 1, 'APIMaxLagThreshold' => 7, 'APICacheHelpTimeout' => 3600, 'APIUselessQueryPages' => [ 'MIMEsearch', 'LinkSearch', ], 'AjaxLicensePreview' => true, 'CrossSiteAJAXdomains' => [ ], 'CrossSiteAJAXdomainExceptions' => [ ], 'AllowedCorsHeaders' => [ 'Accept', 'Accept-Language', 'Content-Language', 'Content-Type', 'Accept-Encoding', 'DNT', 'Origin', 'User-Agent', 'Api-User-Agent', 'Promise-Non-Write-API-Action', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestLocalModuleTestBaseUrl' => null, 'RestModuleOverrides' => [ ], 'RestExternalModules' => [ ], 'RestTermsOfServiceUrl' => null, 'MaxShellMemory' => 307200, 'MaxShellFileSize' => 102400, 'MaxShellTime' => 180, 'MaxShellWallClockTime' => 180, 'ShellCgroup' => false, 'PhpCli' => '/usr/bin/php', 'ShellRestrictionMethod' => 'autodetect', 'ShellboxUrls' => [ 'default' => null, ], 'ShellboxSecretKey' => null, 'ShellboxShell' => '/bin/sh', 'HTTPTimeout' => 25, 'HTTPConnectTimeout' => 5.0, 'HTTPMaxTimeout' => 0, 'HTTPMaxConnectTimeout' => 0, 'HTTPImportTimeout' => 25, 'HTTPUserAgentContact' => false, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'GenerateReqIDFormat' => 'rand24', 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'EventRelayerConfig' => [ 'default' => [ 'class' => 'Wikimedia\\EventRelayer\\EventRelayerNull', ], ], 'Pingback' => false, 'OriginTrials' => [ ], 'ReportToExpiry' => 86400, 'ReportToEndpoints' => [ ], 'FeaturePolicyReportOnly' => [ ], 'SkinsPreferred' => [ 'vector-2022', 'vector', ], 'SpecialContributeSkinsEnabled' => [ ], 'SpecialContributeNewPageTarget' => null, 'EnableEditRecovery' => false, 'EditRecoveryExpiry' => 2592000, 'UseCodexSpecialBlock' => false, 'ShowLogoutConfirmation' => false, 'EnableProtectionIndicators' => true, 'OutputPipelineStages' => [ ], 'FeatureShutdown' => [ ], 'UseLeximorph' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => true, 'ParserOptionsLogUnsafeSampleRate' => 0, 'ReturnExperimentalPFragmentTypes' => [ ], 'UseParsoidLinksUpdate' => null, 'UseParsoidMessages' => false, 'UseParsoidParser' => true, 'SiteLookup' => [ ], ], 'type' => [ 'ConfigRegistry' => 'object', 'AssumeProxiesUseDefaultProtocolPorts' => 'boolean', 'ForceHTTPS' => 'boolean', 'ExtensionDirectory' => [ 'string', 'null', ], 'StyleDirectory' => [ 'string', 'null', ], 'UploadDirectory' => [ 'string', 'boolean', 'null', ], 'Logos' => [ 'object', 'boolean', ], 'ReferrerPolicy' => [ 'array', 'string', 'boolean', ], 'ActionPaths' => 'object', 'MainPageIsDomainRoot' => 'boolean', 'ImgAuthUrlPathMap' => 'object', 'LocalFileRepo' => 'object', 'ForeignFileRepos' => 'array', 'UseSharedUploads' => 'boolean', 'SharedUploadDirectory' => [ 'string', 'null', ], 'SharedUploadPath' => [ 'string', 'null', ], 'HashedSharedUploadDirectory' => 'boolean', 'FetchCommonsDescriptions' => 'boolean', 'SharedUploadDBname' => [ 'boolean', 'string', ], 'SharedUploadDBprefix' => 'string', 'SharedUploadDBschema' => [ 'string', 'null', ], 'CacheSharedUploads' => 'boolean', 'ForeignUploadTargets' => 'array', 'UploadDialog' => 'object', 'FileBackends' => 'object', 'LockManagers' => 'array', 'DefaultLockManager' => [ 'string', 'null', ], 'CopyUploadsDomains' => 'array', 'CopyUploadTimeout' => [ 'boolean', 'integer', ], 'SharedThumbnailScriptPath' => [ 'string', 'boolean', ], 'HashedUploadDirectory' => 'boolean', 'CSPUploadEntryPoint' => 'boolean', 'FileExtensions' => 'array', 'ProhibitedFileExtensions' => 'array', 'MimeTypeExclusions' => 'array', 'TrustedMediaFormats' => 'array', 'MediaHandlers' => 'object', 'NativeImageLazyLoading' => 'boolean', 'ParserTestMediaHandlers' => 'object', 'MaxInterlacingAreas' => 'object', 'SVGConverters' => 'object', 'SVGNativeRendering' => [ 'string', 'boolean', ], 'MaxImageArea' => [ 'string', 'integer', 'boolean', ], 'TiffThumbnailType' => 'array', 'GenerateThumbnailOnParse' => 'boolean', 'EnableAutoRotation' => [ 'boolean', 'null', ], 'Antivirus' => [ 'string', 'null', ], 'AntivirusSetup' => 'object', 'MimeDetectorCommand' => [ 'string', 'null', ], 'XMLMimeTypes' => 'object', 'ImageLimits' => 'array', 'ThumbLimits' => 'array', 'ThumbnailNamespaces' => 'array', 'ThumbnailSteps' => [ 'array', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EmailConfirmationBanner' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'RemoteVirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ExternalLinksDomainGaps' => 'object', 'ContentHandlers' => 'object', 'NamespaceContentModels' => 'object', 'TextModelsToParse' => 'array', 'ExternalStores' => 'array', 'ExternalServers' => 'object', 'DefaultExternalStore' => [ 'array', 'boolean', ], 'RevisionCacheExpiry' => 'integer', 'PageLanguageUseDB' => 'boolean', 'DiffEngine' => [ 'string', 'null', ], 'ExternalDiffEngine' => [ 'string', 'boolean', ], 'Wikidiff2Options' => 'object', 'RequestTimeLimit' => [ 'integer', 'null', ], 'CriticalSectionTimeLimit' => 'number', 'PoolCounterConf' => [ 'object', 'null', ], 'PoolCountClientConf' => 'object', 'MaxUserDBWriteDuration' => [ 'integer', 'boolean', ], 'MaxJobDBWriteDuration' => [ 'integer', 'boolean', ], 'MultiShardSiteStats' => 'boolean', 'ObjectCaches' => 'object', 'WANObjectCache' => 'object', 'MicroStashType' => [ 'string', 'integer', ], 'ParsoidCacheConfig' => 'object', 'ParsoidSelectiveUpdateSampleRate' => 'integer', 'SplitParsoidParserCache' => 'boolean', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'SuspiciousIpExpiry' => [ 'integer', 'boolean', ], 'MemCachedServers' => 'array', 'LocalisationCacheConf' => 'object', 'ExtensionInfoMTime' => [ 'integer', 'boolean', ], 'CdnServers' => 'object', 'CdnServersNoPurge' => 'object', 'HTCPRouting' => 'object', 'GrammarForms' => 'object', 'ExtraInterlanguageLinkPrefixes' => 'array', 'InterlanguageLinkCodeMap' => 'object', 'ExtraLanguageNames' => 'object', 'ExtraLanguageCodes' => 'object', 'DummyLanguageCodes' => 'object', 'DisabledVariants' => 'object', 'ForceUIMsgAsContentMsg' => 'object', 'RawHtmlMessages' => 'array', 'OverrideUcfirstCharacters' => 'object', 'XhtmlNamespaces' => 'object', 'BrowserFormatDetection' => 'string', 'SkinMetaTags' => 'object', 'SkipSkins' => 'object', 'FragmentMode' => 'array', 'FooterIcons' => 'object', 'PageShareSkinsEnabled' => 'array', 'InterwikiLogoOverride' => 'array', 'ResourceModules' => 'object', 'ResourceModuleSkinStyles' => 'object', 'ResourceLoaderSources' => 'object', 'ResourceLoaderMaxage' => 'object', 'ResourceLoaderMaxQueryLength' => [ 'integer', 'boolean', ], 'CanonicalNamespaceNames' => 'object', 'ExtraNamespaces' => 'object', 'ExtraGenderNamespaces' => 'object', 'NamespaceAliases' => 'object', 'CapitalLinkOverrides' => 'object', 'NamespacesWithSubpages' => 'object', 'NamespacesWithoutAutoSummaries' => 'array', 'ContentNamespaces' => 'array', 'ShortPagesNamespaceExclusions' => 'array', 'ExtraSignatureNamespaces' => 'array', 'InvalidRedirectTargets' => 'array', 'LocalInterwikis' => 'array', 'InterwikiCache' => [ 'boolean', 'object', ], 'SiteTypes' => 'object', 'UrlProtocols' => 'array', 'TidyConfig' => 'object', 'ParsoidSettings' => 'object', 'ParsoidExperimentalParserFunctionOutput' => 'boolean', 'NoFollowNsExceptions' => 'array', 'NoFollowDomainExceptions' => 'array', 'ExternalLinksIgnoreDomains' => 'array', 'EnableMagicLinks' => 'object', 'ManualRevertSearchRadius' => 'integer', 'RevertedTagMaxDepth' => 'integer', 'CentralIdLookupProviders' => 'object', 'CentralIdLookupProvider' => 'string', 'UserRegistrationProviders' => 'object', 'PasswordPolicy' => 'object', 'AuthManagerConfig' => [ 'object', 'null', ], 'AuthManagerAutoConfig' => 'object', 'RememberMe' => 'string', 'ReauthenticateTime' => 'object', 'ChangeCredentialsBlacklist' => 'array', 'RemoveCredentialsBlacklist' => 'array', 'PasswordConfig' => 'object', 'PasswordResetRoutes' => 'object', 'SignatureAllowedLintErrors' => 'array', 'ReservedUsernames' => 'array', 'DefaultUserOptions' => 'object', 'ConditionalUserOptions' => 'object', 'HiddenPrefs' => 'array', 'UserJsPrefLimit' => 'integer', 'AuthenticationTokenVersion' => [ 'string', 'null', ], 'SessionProviders' => 'object', 'AutoCreateTempUser' => 'object', 'AutoblockExemptions' => 'array', 'BlockCIDRLimit' => 'object', 'EnableMultiBlocks' => 'boolean', 'GroupPermissions' => 'object', 'PrivilegedGroups' => 'array', 'RevokePermissions' => 'object', 'GroupInheritsPermissions' => 'object', 'ImplicitGroups' => 'array', 'GroupsAddToSelf' => 'object', 'GroupsRemoveFromSelf' => 'object', 'RestrictedGroups' => 'object', 'UserRequirementsPrivateConditions' => 'array', 'RestrictionTypes' => 'array', 'RestrictionLevels' => 'array', 'CascadingRestrictionLevels' => 'array', 'SemiprotectedRestrictionLevels' => 'array', 'NamespaceProtection' => 'object', 'RestrictUserPageEditing' => 'boolean', 'NonincludableNamespaces' => 'object', 'Autopromote' => 'object', 'AutopromoteOnce' => 'object', 'AutopromoteOnceRCExcludedGroups' => 'array', 'AddGroups' => 'object', 'RemoveGroups' => 'object', 'AvailableRights' => 'array', 'ImplicitRights' => 'array', 'AccountCreationThrottle' => [ 'integer', 'array', ], 'TempAccountCreationThrottle' => 'array', 'TempAccountNameAcquisitionThrottle' => 'array', 'SpamRegex' => 'array', 'SummarySpamRegex' => 'array', 'DnsBlacklistUrls' => 'array', 'ProxyList' => [ 'string', 'array', ], 'ProxyWhitelist' => 'array', 'SoftBlockRanges' => 'array', 'RateLimits' => 'object', 'RateLimitsExcludedIPs' => 'array', 'ExternalQuerySources' => 'object', 'PasswordAttemptThrottle' => 'array', 'GrantPermissions' => 'object', 'GrantPermissionGroups' => 'object', 'GrantRiskGroups' => 'object', 'EnableBotPasswords' => 'boolean', 'BotPasswordsCluster' => [ 'string', 'boolean', ], 'BotPasswordsDatabase' => [ 'string', 'boolean', ], 'BotPasswordsLimit' => 'integer', 'ReauthenticateForActions' => 'object', 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPUseReportURIDirective' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => 'array', 'DeviceBoundSessions' => 'boolean', 'DeviceBoundSessionsReportOnly' => 'boolean', 'DeviceBoundSessionCookieName' => 'string', 'DeviceBoundSessionCredentialTTL' => 'integer', 'DeviceBoundSessionChallengeTTL' => 'integer', 'DeviceBoundSessionBindingTTL' => 'integer', 'DeviceBoundSessionScopeExcludes' => 'array', 'TrxProfilerLimits' => 'object', 'DebugLogGroups' => 'object', 'MWLoggerDefaultSpi' => 'object', 'Profiler' => 'object', 'StatsTarget' => [ 'string', 'null', ], 'StatsFormat' => [ 'string', 'null', ], 'StatsPrefix' => 'string', 'OpenTelemetryConfig' => [ 'object', 'null', ], 'OpenSearchTemplates' => 'object', 'NamespacesToBeSearchedDefault' => 'object', 'SitemapNamespaces' => [ 'boolean', 'array', ], 'SitemapNamespacesPriorities' => [ 'boolean', 'object', ], 'SitemapApiConfig' => 'object', 'SpecialSearchFormOptions' => 'object', 'SearchMatchRedirectPreference' => 'boolean', 'SearchRunSuggestedQuery' => 'boolean', 'PreviewOnOpenNamespaces' => 'object', 'ReadOnlyWatchedItemStore' => 'boolean', 'GitRepositoryViewers' => 'object', 'InstallerInitialPages' => 'array', 'RCLinkLimits' => 'array', 'RCLinkDays' => 'array', 'RCFeeds' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RestrictedTagViewRights' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => 'boolean', 'EnableWatchstarPopover' => 'boolean', 'EnableWatchlistLabels' => 'boolean', 'WatchlistLabelsMaxPerUser' => 'integer', 'WatchlistPurgeRate' => 'number', 'WatchlistExpiryMaxDuration' => [ 'string', 'null', ], 'EnableChangesListQueryPartitioning' => 'boolean', 'ImportSources' => 'object', 'ExtensionFunctions' => 'array', 'ExtensionMessagesFiles' => 'object', 'MessagesDirs' => 'object', 'TranslationAliasesDirs' => 'object', 'ExtensionEntryPointListFiles' => 'object', 'ValidSkinNames' => 'object', 'SpecialPages' => 'object', 'ExtensionCredits' => 'object', 'Hooks' => 'object', 'ServiceWiringFiles' => 'array', 'JobClasses' => 'object', 'JobTypesExcludedFromDefaultQueue' => 'array', 'JobBackoffThrottling' => 'object', 'JobTypeConf' => 'object', 'SpecialPageCacheUpdates' => 'object', 'PagePropLinkInvalidations' => 'object', 'TempCategoryCollations' => 'array', 'SortedCategories' => 'boolean', 'TrackingCategories' => 'array', 'LogTypes' => 'array', 'LogRestrictions' => 'object', 'FilterLogTypes' => 'object', 'LogNames' => 'object', 'LogHeaders' => 'object', 'LogActions' => 'object', 'LogActionsHandlers' => 'object', 'ActionFilteredLogs' => 'object', 'WatchUserPageOnAccountCreation' => 'boolean', 'RangeContributionsCIDRLimit' => 'object', 'Actions' => 'object', 'NamespaceRobotPolicies' => 'object', 'ArticleRobotPolicies' => 'object', 'ExemptFromUserRobotsControl' => [ 'array', 'null', ], 'APIModules' => 'object', 'APIFormatModules' => 'object', 'APIMetaModules' => 'object', 'APIPropModules' => 'object', 'APIListModules' => 'object', 'APIUselessQueryPages' => 'array', 'CrossSiteAJAXdomains' => 'object', 'CrossSiteAJAXdomainExceptions' => 'object', 'AllowedCorsHeaders' => 'array', 'RestAPIAdditionalRouteFiles' => 'array', 'RestLocalModuleTestBaseUrl' => [ 'string', 'null', ], 'RestModuleOverrides' => 'object', 'RestExternalModules' => 'object', 'RestTermsOfServiceUrl' => [ 'string', 'null', ], 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'HTTPUserAgentContact' => [ 'string', 'boolean', ], 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'GenerateReqIDFormat' => 'string', 'EventRelayerConfig' => 'object', 'Pingback' => 'boolean', 'OriginTrials' => 'array', 'ReportToExpiry' => 'integer', 'ReportToEndpoints' => 'array', 'FeaturePolicyReportOnly' => 'array', 'SkinsPreferred' => 'array', 'SpecialContributeSkinsEnabled' => 'array', 'SpecialContributeNewPageTarget' => [ 'string', 'null', ], 'EnableEditRecovery' => 'boolean', 'EditRecoveryExpiry' => 'integer', 'UseCodexSpecialBlock' => 'boolean', 'ShowLogoutConfirmation' => 'boolean', 'EnableProtectionIndicators' => 'boolean', 'OutputPipelineStages' => 'object', 'FeatureShutdown' => 'array', 'UseLeximorph' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', 'ReturnExperimentalPFragmentTypes' => 'array', 'UseParsoidLinksUpdate' => [ 'boolean', 'null', ], 'UseParsoidMessages' => [ 'boolean', 'null', ], 'UseParsoidParser' => 'boolean', 'SiteLookup' => 'object', ], 'mergeStrategy' => [ 'TiffThumbnailType' => 'replace', 'LBFactoryConf' => 'replace', 'InterwikiCache' => 'replace', 'PasswordPolicy' => 'array_replace_recursive', 'AuthManagerAutoConfig' => 'array_plus_2d', 'GroupPermissions' => 'array_plus_2d', 'RevokePermissions' => 'array_plus_2d', 'AddGroups' => 'array_merge_recursive', 'RemoveGroups' => 'array_merge_recursive', 'RateLimits' => 'array_plus_2d', 'GrantPermissions' => 'array_plus_2d', 'MWLoggerDefaultSpi' => 'replace', 'Profiler' => 'replace', 'Hooks' => 'array_merge_recursive', 'RestModuleOverrides' => 'array_replace_recursive', 'RestExternalModules' => 'array_replace_recursive', ], 'dynamicDefault' => [ 'UsePathInfo' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUsePathInfo', ], ], 'Script' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultScript', ], ], 'LoadScript' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLoadScript', ], ], 'RestPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultRestPath', ], ], 'StylePath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultStylePath', ], ], 'LocalStylePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalStylePath', ], ], 'ExtensionAssetsPath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultExtensionAssetsPath', ], ], 'ArticlePath' => [ 'use' => [ 'Script', 'UsePathInfo', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultArticlePath', ], ], 'UploadPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUploadPath', ], ], 'FileCacheDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultFileCacheDirectory', ], ], 'Logo' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLogo', ], ], 'DeletedDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDeletedDirectory', ], ], 'ShowEXIF' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultShowEXIF', ], ], 'SharedPrefix' => [ 'use' => [ 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedPrefix', ], ], 'SharedSchema' => [ 'use' => [ 'DBmwschema', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedSchema', ], ], 'DBerrorLogTZ' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDBerrorLogTZ', ], ], 'Localtimezone' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocaltimezone', ], ], 'LocalTZoffset' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalTZoffset', ], ], 'ResourceBasePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultResourceBasePath', ], ], 'MetaNamespace' => [ 'use' => [ 'Sitename', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultMetaNamespace', ], ], 'CookieSecure' => [ 'use' => [ 'ForceHTTPS', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookieSecure', ], ], 'CookiePrefix' => [ 'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookiePrefix', ], ], 'ReadOnlyFile' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultReadOnlyFile', ], ], ], ], 'config-schema' => [ 'UploadStashScalerBaseUrl' => [ 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo', ], 'IllegalFileChars' => [ 'deprecated' => 'since 1.41; no longer customizable', ], 'ThumbnailNamespaces' => [ 'items' => [ 'type' => 'integer', ], ], 'LocalDatabases' => [ 'items' => [ 'type' => 'string', ], ], 'ParserCacheFilterConfig' => [ 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of namespace IDs to filter definitions.', 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of filter names to values.', 'properties' => [ 'minCpuTime' => [ 'type' => 'number', ], ], ], ], ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => [ 'integer', 'array', ], ], ], 'ChangeCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'RemoveCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'GroupPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GroupInheritsPermissions' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'AvailableRights' => [ 'items' => [ 'type' => 'string', ], ], 'ImplicitRights' => [ 'items' => [ 'type' => 'string', ], ], 'SoftBlockRanges' => [ 'items' => [ 'type' => 'string', ], ], 'ExternalQuerySources' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'enabled' => [ 'type' => 'boolean', 'default' => false, ], 'url' => [ 'type' => 'string', 'format' => 'uri', ], 'timeout' => [ 'type' => 'integer', 'default' => 10, ], ], 'required' => [ 'enabled', 'url', ], 'additionalProperties' => false, ], ], 'GrantPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GrantPermissionGroups' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'SitemapNamespacesPriorities' => [ 'deprecated' => 'since 1.45 and ignored', ], 'SitemapApiConfig' => [ 'additionalProperties' => [ 'enabled' => [ 'type' => 'bool', ], 'sitemapsPerIndex' => [ 'type' => 'int', ], 'pagesPerSitemap' => [ 'type' => 'int', ], 'expiry' => [ 'type' => 'int', ], 'skipRedirects' => [ 'type' => 'bool', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], 'UseCopyrightUpload' => [ 'deprecated' => 'since 1.47 This feature is being removed.', ], 'JobBackoffThrottling' => [ 'additionalProperties' => [ 'type' => 'number', ], ], 'JobTypeConf' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'class' => [ 'type' => 'string', ], 'order' => [ 'type' => 'string', ], 'claimTTL' => [ 'type' => 'integer', ], ], ], ], 'TrackingCategories' => [ 'deprecated' => 'since 1.25 Extensions should now register tracking categories using the new extension registration system.', ], 'RangeContributionsCIDRLimit' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'RestModuleOverrides' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'availability' => [ 'type' => 'string', ], 'groups' => [ 'type' => 'array', ], ], ], ], 'RestExternalModules' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'info' => [ 'type' => 'object', 'properties' => [ 'version' => [ 'type' => 'string', ], 'title' => [ 'type' => 'string', ], 'x-i18n-title' => [ 'type' => 'string', ], 'description' => [ 'type' => 'string', ], 'x-i18n-description' => [ 'type' => 'string', ], ], 'required' => [ 'version', ], ], 'base' => [ 'type' => 'string', 'format' => 'uri', ], 'spec' => [ 'type' => 'string', 'format' => 'uri', ], ], 'required' => [ 'info', 'base', 'spec', ], ], ], 'ShellboxUrls' => [ 'additionalProperties' => [ 'type' => [ 'string', 'boolean', 'null', ], ], ], ], 'obsolete-config' => [ 'MangleFlashPolicy' => 'Since 1.39; no longer has any effect.', 'EnableOpenSearchSuggest' => 'Since 1.35, no longer used', 'AutoloadAttemptLowercase' => 'Since 1.40; no longer has any effect.', ],]
This interface represents the authority associated with the current execution context,...
Definition Authority.php:23
getUser()
Returns the performer of the actions associated with this authority.
Interface for objects representing user identity.
addQuotes( $s)
Escape and quote a raw value string for use in a SQL query.
A database connection without write operations.
newSelectQueryBuilder()
Create an empty SelectQueryBuilder which can be used to run queries against this connection.
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects.
expr(string $field, string $op, $value)
See Expression\__construct().
Result wrapper for grabbing data queried from an IDatabase object.
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for ins...