From: Aaron Schulz Date: Wed, 13 Jun 2018 23:52:31 +0000 (-0700) Subject: Make LocalFile file locking calls use Status::wrap X-Git-Tag: 1.34.0-rc.0~5060^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=505a0e913ac10fd79787b51aa340d2bc28bebdf1;p=lhc%2Fweb%2Fwiklou.git Make LocalFile file locking calls use Status::wrap This avoids the assumption that a wrapper was set in the FileBackend. Change-Id: I4d41d63b00e41476d885f714d17d1ba62b63b6ec --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index adad9ad15f..e86f292703 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2208,7 +2208,7 @@ class LocalFile extends File { // If extra data (metadata) was not loaded then it must have been large return $this->extraDataLoaded - && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN; + && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN; } /** @@ -2216,9 +2216,9 @@ class LocalFile extends File { * @since 1.28 */ public function acquireFileLock() { - return $this->getRepo()->getBackend()->lockFiles( + return Status::wrap( $this->getRepo()->getBackend()->lockFiles( [ $this->getPath() ], LockManager::LOCK_EX, 10 - ); + ) ); } /** @@ -2226,9 +2226,9 @@ class LocalFile extends File { * @since 1.28 */ public function releaseFileLock() { - return $this->getRepo()->getBackend()->unlockFiles( + return Status::wrap( $this->getRepo()->getBackend()->unlockFiles( [ $this->getPath() ], LockManager::LOCK_EX - ); + ) ); } /**