Merge "Convert doDeleteArticleReal to startAtomic()/endAtomic()"
[lhc/web/wiklou.git] / includes / filerepo / FileRepo.php
index 7370c5c..e79c06b 100644 (file)
@@ -52,6 +52,9 @@ class FileRepo {
        /** @var bool */
        protected $hasSha1Storage = false;
 
+       /** @var bool */
+       protected $supportsSha1URLs = false;
+
        /** @var FileBackend */
        protected $backend;
 
@@ -76,7 +79,7 @@ class FileRepo {
        protected $scriptDirUrl;
 
        /** @var string Script extension of the MediaWiki installation, equivalent
-        *    to $wgScriptExtension, e.g. .php5 defaults to .php */
+        *    to the old $wgScriptExtension, e.g. .php5 defaults to .php */
        protected $scriptExtension;
 
        /** @var string Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 */
@@ -200,6 +203,8 @@ class FileRepo {
                                $this->zones[$zone]['urlsByExt'] = array();
                        }
                }
+
+               $this->supportsSha1URLs = !empty( $info['supportsSha1URLs'] );
        }
 
        /**
@@ -753,7 +758,6 @@ class FileRepo {
                }
                if ( !is_null( $this->articleUrl ) ) {
                        # "http://example.com/wiki/$1"
-                       #
                        # We use "Image:" as the canonical namespace for
                        # compatibility across all MediaWiki versions.
                        return str_replace( '$1',
@@ -761,7 +765,6 @@ class FileRepo {
                }
                if ( !is_null( $this->scriptDirUrl ) ) {
                        # "http://example.com/w"
-                       #
                        # We use "Image:" as the canonical namespace for
                        # compatibility across all MediaWiki versions,
                        # and just sort of hope index.php is right. ;)
@@ -1896,6 +1899,14 @@ class FileRepo {
        public function hasSha1Storage() {
                return $this->hasSha1Storage;
        }
+
+       /**
+        * Returns whether or not repo supports having originals SHA-1s in the thumb URLs
+        * @return boolean
+        */
+       public function supportsSha1URLs() {
+               return $this->supportsSha1URLs;
+       }
 }
 
 /**