Merge "Reformatted some array parameter docs."
[lhc/web/wiklou.git] / includes / filebackend / FileOp.php
index 0d64a44..bb0ab57 100644 (file)
@@ -42,7 +42,6 @@ abstract class FileOp {
        protected $state = self::STATE_NEW; // integer
        protected $failed = false; // boolean
        protected $async = false; // boolean
-       protected $useLatest = true; // boolean
        protected $batchId; // string
 
        protected $doOperation = true; // boolean; operation is not a no-op
@@ -124,16 +123,6 @@ abstract class FileOp {
                $this->batchId = $batchId;
        }
 
-       /**
-        * Whether to allow stale data for file reads and stat checks
-        *
-        * @param $allowStale bool
-        * @return void
-        */
-       final public function allowStaleReads( $allowStale ) {
-               $this->useLatest = !$allowStale;
-       }
-
        /**
         * Get the value of the parameter with the given name
         *
@@ -174,11 +163,11 @@ abstract class FileOp {
        /**
         * Update a dependency tracking array to account for this operation
         *
-        * @param $deps Array Prior path reads/writes; format of FileOp::newPredicates()
+        * @param array $deps Prior path reads/writes; format of FileOp::newPredicates()
         * @return Array
         */
        final public function applyDependencies( array $deps ) {
-               $deps['read']  += array_fill_keys( $this->storagePathsRead(), 1 );
+               $deps['read'] += array_fill_keys( $this->storagePathsRead(), 1 );
                $deps['write'] += array_fill_keys( $this->storagePathsChanged(), 1 );
                return $deps;
        }
@@ -186,7 +175,7 @@ abstract class FileOp {
        /**
         * Check if this operation changes files listed in $paths
         *
-        * @param $paths Array Prior path reads/writes; format of FileOp::newPredicates()
+        * @param array $paths Prior path reads/writes; format of FileOp::newPredicates()
         * @return boolean
         */
        final public function dependsOn( array $deps ) {
@@ -206,8 +195,8 @@ abstract class FileOp {
        /**
         * Get the file journal entries for this file operation
         *
-        * @param $oPredicates Array Pre-op info about files (format of FileOp::newPredicates)
-        * @param $nPredicates Array Post-op info about files (format of FileOp::newPredicates)
+        * @param array $oPredicates Pre-op info about files (format of FileOp::newPredicates)
+        * @param array $nPredicates Post-op info about files (format of FileOp::newPredicates)
         * @return Array
         */
        final public function getJournalEntries( array $oPredicates, array $nPredicates ) {
@@ -403,7 +392,7 @@ abstract class FileOp {
        /**
         * Check if a file will exist in storage when this operation is attempted
         *
-        * @param $source string Storage path
+        * @param string $source Storage path
         * @param $predicates Array
         * @return bool
         */
@@ -411,7 +400,7 @@ abstract class FileOp {
                if ( isset( $predicates['exists'][$source] ) ) {
                        return $predicates['exists'][$source]; // previous op assures this
                } else {
-                       $params = array( 'src' => $source, 'latest' => $this->useLatest );
+                       $params = array( 'src' => $source, 'latest' => true );
                        return $this->backend->fileExists( $params );
                }
        }
@@ -419,7 +408,7 @@ abstract class FileOp {
        /**
         * Get the SHA-1 of a file in storage when this operation is attempted
         *
-        * @param $source string Storage path
+        * @param string $source Storage path
         * @param $predicates Array
         * @return string|bool False on failure
         */
@@ -429,7 +418,7 @@ abstract class FileOp {
                } elseif ( isset( $predicates['exists'][$source] ) && !$predicates['exists'][$source] ) {
                        return false; // previous op assures this
                } else {
-                       $params = array( 'src' => $source, 'latest' => $this->useLatest );
+                       $params = array( 'src' => $source, 'latest' => true );
                        return $this->backend->getFileSha1Base36( $params );
                }
        }