diff options
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/OwnCloud.php')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/OwnCloud.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php index d5562a3cb32..12c305de750 100644 --- a/apps/files_external/lib/Lib/Storage/OwnCloud.php +++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -6,6 +7,7 @@ */ namespace OCA\Files_External\Lib\Storage; +use OC\Files\Storage\DAV; use OCP\Files\Storage\IDisableEncryptionStorage; use Sabre\DAV\Client; @@ -16,20 +18,20 @@ use Sabre\DAV\Client; * http://%host/%context/remote.php/webdav/%root * */ -class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorage { +class OwnCloud extends DAV implements IDisableEncryptionStorage { public const OC_URL_SUFFIX = 'remote.php/webdav'; - public function __construct($params) { + public function __construct(array $parameters) { // extract context path from host if specified // (owncloud install path on host) - $host = $params['host']; + $host = $parameters['host']; // strip protocol - if (substr($host, 0, 8) === "https://") { + if (substr($host, 0, 8) === 'https://') { $host = substr($host, 8); - $params['secure'] = true; - } elseif (substr($host, 0, 7) === "http://") { + $parameters['secure'] = true; + } elseif (substr($host, 0, 7) === 'http://') { $host = substr($host, 7); - $params['secure'] = false; + $parameters['secure'] = false; } $contextPath = ''; $hostSlashPos = strpos($host, '/'); @@ -42,20 +44,20 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag $contextPath .= '/'; } - if (isset($params['root'])) { - $root = '/' . ltrim($params['root'], '/'); + if (isset($parameters['root'])) { + $root = '/' . ltrim($parameters['root'], '/'); } else { $root = '/'; } - $params['host'] = $host; - $params['root'] = $contextPath . self::OC_URL_SUFFIX . $root; - $params['authType'] = Client::AUTH_BASIC; + $parameters['host'] = $host; + $parameters['root'] = $contextPath . self::OC_URL_SUFFIX . $root; + $parameters['authType'] = Client::AUTH_BASIC; - parent::__construct($params); + parent::__construct($parameters); } - public function needsPartFile() { + public function needsPartFile(): bool { return false; } } |