Index: trunk/phase3/includes/filerepo/backend/FileOp.php |
— | — | @@ -63,12 +63,13 @@ |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | | - * Allow stale data for file reads and existence checks |
| 67 | + * Whether to allow stale data for file reads and stat checks |
68 | 68 | * |
| 69 | + * @param $allowStale bool |
69 | 70 | * @return void |
70 | 71 | */ |
71 | | - final protected function allowStaleReads() { |
72 | | - $this->useLatest = false; |
| 72 | + final protected function allowStaleReads( $allowStale ) { |
| 73 | + $this->useLatest = !$allowStale; |
73 | 74 | } |
74 | 75 | |
75 | 76 | /** |
— | — | @@ -105,9 +106,7 @@ |
106 | 107 | $predicates = FileOp::newPredicates(); // account for previous op in prechecks |
107 | 108 | // Do pre-checks for each operation; abort on failure... |
108 | 109 | foreach ( $performOps as $index => $fileOp ) { |
109 | | - if ( $allowStale ) { |
110 | | - $fileOp->allowStaleReads(); // allow potentially stale reads |
111 | | - } |
| 110 | + $fileOp->allowStaleReads( $allowStale ); |
112 | 111 | $subStatus = $fileOp->precheck( $predicates ); |
113 | 112 | $status->merge( $subStatus ); |
114 | 113 | if ( !$subStatus->isOK() ) { // operation failed? |