Deprecate WikiRevision::$fileIsTemp and fix $isTemp
authoraddshore <addshorewiki@gmail.com>
Thu, 16 Mar 2017 10:09:03 +0000 (10:09 +0000)
committeraddshore <addshorewiki@gmail.com>
Tue, 21 Mar 2017 23:09:34 +0000 (23:09 +0000)
Cleanup from 43d5d3b682cc1733ad01a837d11af4a402d57e6a

This commit introduces both $fileIsTemp $isTemp
It would appear that the intent was to have one property here
and it looks like both of these are meant to do the same thing.

It also looks as if both public properties are actually unused
(only used by the getter and setters)

As isTemp will now sometimes return true line 766 $autoDeleteSource
will be true in new cases.
As a result $tmpFile->autocollect(); will be called in more cases

Change-Id: I8014172fb9fd7a0e4a89d0872bafdf6c50f92646

RELEASE-NOTES-1.29
includes/import/WikiRevision.php

index b9a93f1..e2f74da 100644 (file)
@@ -264,6 +264,7 @@ changes to languages because of Phabricator reports.
   breaking change.
 * Removed 'jquery.arrowSteps' module. (deprecated since 1.28)
 * The 'jquery.autoEllipsis' ResourceLoader module is now deprecated.
+* WikiRevision::$fileIsTemp was deprecated.
 
 == Compatibility ==
 
index edc3548..1f577b6 100644 (file)
@@ -94,11 +94,6 @@ class WikiRevision {
        public $sha1base36 = false;
 
        /**
-        * @var bool
-        * @todo Unused?
-        */
-       public $isTemp = false;
-
        /** @var string */
        public $archiveName = '';
 
@@ -107,7 +102,18 @@ class WikiRevision {
        /** @var mixed */
        protected $src;
 
-       /** @todo Unused? */
+       /**
+        * @since 1.18
+        * @var bool
+        */
+       public $isTemp = false;
+
+       /**
+        * @since 1.18
+        * @deprecated 1.29 use Wikirevision::isTempSrc()
+        * First written to in 43d5d3b682cc1733ad01a837d11af4a402d57e6a
+        * Actually introduced in 52cd34acf590e5be946b7885ffdc13a157c1c6cf
+        */
        public $fileIsTemp;
 
        /** @var bool */
@@ -220,6 +226,7 @@ class WikiRevision {
        public function setFileSrc( $src, $isTemp ) {
                $this->fileSrc = $src;
                $this->fileIsTemp = $isTemp;
+               $this->isTemp = $isTemp;
        }
 
        /**