Merge "Add tablesUsed to RevisionStoreDbTest"
[lhc/web/wiklou.git] / includes / filerepo / file / LocalFile.php
index 0b730f6..7be8f06 100644 (file)
@@ -84,7 +84,7 @@ class LocalFile extends File {
        protected $deleted;
 
        /** @var string */
-       protected $repoClass = 'LocalRepo';
+       protected $repoClass = LocalRepo::class;
 
        /** @var int Number of line to return by nextHistoryLine() (constructor) */
        private $historyLine;
@@ -200,6 +200,7 @@ class LocalFile extends File {
         * @return array
         */
        static function selectFields() {
+               wfDeprecated( __METHOD__, '1.31' );
                return [
                        'img_name',
                        'img_size',
@@ -1283,7 +1284,7 @@ class LocalFile extends File {
                        ) {
                                $props = $this->repo->getFileProps( $srcPath );
                        } else {
-                               $mwProps = new MWFileProps( MimeMagic::singleton() );
+                               $mwProps = new MWFileProps( MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
                                $props = $mwProps->getPropsFromPath( $srcPath, true );
                        }
                }
@@ -1739,7 +1740,9 @@ class LocalFile extends File {
                }
 
                # Invalidate cache for all pages using this file
-               DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' ) );
+               DeferredUpdates::addUpdate(
+                       new HTMLCacheUpdate( $this->getTitle(), 'imagelinks', 'file-upload' )
+               );
 
                return Status::newGood();
        }