Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply known mtime wrapper for external storages
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Oct 24, 2023
commit 2bea43bf4fb225c48e0393d7d630265220da7a28
28 changes: 10 additions & 18 deletions apps/files_external/lib/Config/ConfigAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use OC\Files\Storage\FailedStorage;
use OC\Files\Storage\Wrapper\Availability;
use OC\Files\Storage\Wrapper\KnownMtime;
use OCA\Files_External\Lib\PersonalMount;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\UserGlobalStoragesService;
Expand All @@ -40,29 +41,17 @@
use OCP\Files\Storage\IStorageFactory;
use OCP\Files\StorageNotAvailableException;
use OCP\IUser;
use Psr\Clock\ClockInterface;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a dependency on 25


/**
* Make the old files_external config work with the new public mount config api
*/
class ConfigAdapter implements IMountProvider {

/** @var UserStoragesService */
private $userStoragesService;

/** @var UserGlobalStoragesService */
private $userGlobalStoragesService;

/**
* @param UserStoragesService $userStoragesService
* @param UserGlobalStoragesService $userGlobalStoragesService
*/
public function __construct(
UserStoragesService $userStoragesService,
UserGlobalStoragesService $userGlobalStoragesService
) {
$this->userStoragesService = $userStoragesService;
$this->userGlobalStoragesService = $userGlobalStoragesService;
}
private UserStoragesService $userStoragesService,
private UserGlobalStoragesService $userGlobalStoragesService,
private ClockInterface $clock,
) {}

/**
* Process storage ready for mounting
Expand Down Expand Up @@ -155,7 +144,10 @@ public function getMountsForUser(IUser $user, IStorageFactory $loader) {
$this->userStoragesService,
$storageConfig,
$storageConfig->getId(),
$storage,
new KnownMtime([
'storage' => $storage,
'clock' => $this->clock,
]),
'/' . $user->getUID() . '/files' . $storageConfig->getMountPoint(),
null,
$loader,
Expand Down
1 change: 0 additions & 1 deletion tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use OC\Files\Storage\Temporary;
use OC\Files\Storage\Wrapper\KnownMtime;
use OCP\Constants;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Clock\ClockInterface;
use Test\Files\Storage\Storage;
Expand Down