diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-08-07 17:31:03 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-08-07 17:31:03 +0200 |
commit | b3a1aef93414ee1ec3a124f66a6964a27338b44c (patch) | |
tree | c933beada324e6bb810c4c57dbb1f7dde5320bbf /lib/private/files/storage/common.php | |
parent | 404b5a2e4a4ddb1b2d6b8c430686b4c3fb68beb0 (diff) | |
parent | 75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d (diff) | |
download | nextcloud-server-b3a1aef93414ee1ec3a124f66a6964a27338b44c.tar.gz nextcloud-server-b3a1aef93414ee1ec3a124f66a6964a27338b44c.zip |
Merge pull request #13641 from owncloud/cache-storage-status
Store storage availability in database
Diffstat (limited to 'lib/private/files/storage/common.php')
-rw-r--r-- | lib/private/files/storage/common.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 78f35ad4a6f..a5ed5fd3996 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -404,6 +404,11 @@ abstract class Common implements Storage { return implode('/', $output); } + /** + * Test a storage for availability + * + * @return bool + */ public function test() { if ($this->stat('')) { return true; @@ -650,4 +655,18 @@ abstract class Common implements Storage { public function changeLock($path, $type, ILockingProvider $provider) { $provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); } + + /** + * @return array [ available, last_checked ] + */ + public function getAvailability() { + return $this->getStorageCache()->getAvailability(); + } + + /** + * @param bool $isAvailable + */ + public function setAvailability($isAvailable) { + $this->getStorageCache()->setAvailability($isAvailable); + } } |