diff options
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/FTP.php')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/FTP.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index 51b269b3eb0..944964de7a6 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-only @@ -12,7 +13,10 @@ use OC\Files\Storage\Common; use OC\Files\Storage\PolyFill\CopyDirectory; use OCP\Constants; use OCP\Files\FileInfo; +use OCP\Files\IMimeTypeDetector; use OCP\Files\StorageNotAvailableException; +use OCP\ITempManager; +use OCP\Server; use Psr\Log\LoggerInterface; class FTP extends Common { @@ -101,7 +105,7 @@ class FTP extends Common { if ($this->is_dir($path)) { $list = $this->getConnection()->mlsd($this->buildPath($path)); if (!$list) { - \OC::$server->get(LoggerInterface::class)->warning("Unable to get last modified date for ftp folder ($path), failed to list folder contents"); + Server::get(LoggerInterface::class)->warning("Unable to get last modified date for ftp folder ($path), failed to list folder contents"); return time(); } $currentDir = current(array_filter($list, function ($item) { @@ -115,7 +119,7 @@ class FTP extends Common { } return $time->getTimestamp(); } else { - \OC::$server->get(LoggerInterface::class)->warning("Unable to get last modified date for ftp folder ($path), folder contents doesn't include current folder"); + Server::get(LoggerInterface::class)->warning("Unable to get last modified date for ftp folder ($path), folder contents doesn't include current folder"); return time(); } } else { @@ -270,7 +274,7 @@ class FTP extends Common { if (!$this->isCreatable(dirname($path))) { return false; } - $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); + $tmpFile = Server::get(ITempManager::class)->getTemporaryFile(); } $source = fopen($tmpFile, $mode); return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $path): void { @@ -322,7 +326,7 @@ class FTP extends Common { public function getDirectoryContent(string $directory): \Traversable { $files = $this->getConnection()->mlsd($this->buildPath($directory)); - $mimeTypeDetector = \OC::$server->getMimeTypeDetector(); + $mimeTypeDetector = Server::get(IMimeTypeDetector::class); foreach ($files as $file) { $name = $file['name']; |