Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove old legacy external storage migration logic #30991

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 1 addition & 9 deletions apps/files_external/lib/Config/ConfigAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use OC\Files\Storage\Wrapper\Availability;
use OCA\Files_External\Lib\PersonalMount;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Migration\StorageMigrator;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\Files\Config\IMountProvider;
Expand All @@ -52,22 +51,17 @@ class ConfigAdapter implements IMountProvider {

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

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

/**
Expand Down Expand Up @@ -120,8 +114,6 @@ private function constructStorage(StorageConfig $storageConfig) {
* @return \OCP\Files\Mount\IMountPoint[]
*/
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
$this->migrator->migrateUser($user);

$this->userStoragesService->setUser($user);
$this->userGlobalStoragesService->setUser($user);

Expand Down
135 changes: 0 additions & 135 deletions apps/files_external/lib/Migration/StorageMigrator.php

This file was deleted.

24 changes: 1 addition & 23 deletions apps/files_external/lib/MountConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\Files\StorageNotAvailableException;
use OCP\IUser;
use phpseclib\Crypt\AES;

/**
Expand Down Expand Up @@ -144,29 +145,6 @@ public static function getBackendStatus($class, $options, $isPersonal, $testOnly
return StorageNotAvailableException::STATUS_ERROR;
}

/**
* Read the mount points in the config file into an array
*
* @param string|null $user If not null, personal for $user, otherwise system
* @return array
*/
public static function readData($user = null) {
if (isset($user)) {
$jsonFile = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json';
} else {
$config = \OC::$server->getConfig();
$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
$jsonFile = $config->getSystemValue('mount_file', $datadir . '/mount.json');
}
if (is_file($jsonFile)) {
$mountPoints = json_decode(file_get_contents($jsonFile), true);
if (is_array($mountPoints)) {
return $mountPoints;
}
}
return [];
}

/**
* Get backend dependency message
* TODO: move into AppFramework along with templates
Expand Down
56 changes: 0 additions & 56 deletions apps/files_external/lib/Service/UserLegacyStoragesService.php

This file was deleted.