aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-09 23:39:58 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-10 00:02:59 +0200
commit065ef14cb025f6664c7a3ed1aa89d333a2944342 (patch)
tree72cba2059ca302ffa3fdfa2a1e5a9ffc604285d0 /apps/files_external/lib
parente18e4511d0988fd1133f0bfc553f38e5a29a4565 (diff)
downloadnextcloud-server-065ef14cb025f6664c7a3ed1aa89d333a2944342.tar.gz
nextcloud-server-065ef14cb025f6664c7a3ed1aa89d333a2944342.zip
Move OC_Mount_Config to proper classname and remove OC::$CLASSPATH usage in files_external
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Command/Verify.php2
-rw-r--r--apps/files_external/lib/Config/ConfigAdapter.php2
-rw-r--r--apps/files_external/lib/Controller/ApiController.php2
-rw-r--r--apps/files_external/lib/Controller/StoragesController.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/LegacyBackend.php2
-rw-r--r--apps/files_external/lib/MountConfig.php (renamed from apps/files_external/lib/config.php)6
-rw-r--r--apps/files_external/lib/Service/GlobalStoragesService.php18
-rw-r--r--apps/files_external/lib/Service/LegacyStoragesService.php8
-rw-r--r--apps/files_external/lib/Service/UserLegacyStoragesService.php2
-rw-r--r--apps/files_external/lib/Service/UserStoragesService.php2
-rw-r--r--apps/files_external/lib/Settings/Admin.php2
-rw-r--r--apps/files_external/lib/Settings/Personal.php2
12 files changed, 26 insertions, 24 deletions
diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php
index e5bfb3052ee..dbc6960e969 100644
--- a/apps/files_external/lib/Command/Verify.php
+++ b/apps/files_external/lib/Command/Verify.php
@@ -118,7 +118,7 @@ class Verify extends Base {
$backend = $storage->getBackend();
// update status (can be time-consuming)
$storage->setStatus(
- \OC_Mount_Config::getBackendStatus(
+ \OCA\Files_External\MountConfig::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
false
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php
index fa33f3de793..24610ec4bf6 100644
--- a/apps/files_external/lib/Config/ConfigAdapter.php
+++ b/apps/files_external/lib/Config/ConfigAdapter.php
@@ -80,7 +80,7 @@ class ConfigAdapter implements IMountProvider {
*/
private function prepareStorageConfig(StorageConfig &$storage, IUser $user) {
foreach ($storage->getBackendOptions() as $option => $value) {
- $storage->setBackendOption($option, \OC_Mount_Config::substitutePlaceholdersInConfig($value, $user->getUID()));
+ $storage->setBackendOption($option, \OCA\Files_External\MountConfig::substitutePlaceholdersInConfig($value, $user->getUID()));
}
$objectStore = $storage->getBackendOption('objectstore');
diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php
index 6418e5d73ad..de2942e554a 100644
--- a/apps/files_external/lib/Controller/ApiController.php
+++ b/apps/files_external/lib/Controller/ApiController.php
@@ -99,7 +99,7 @@ class ApiController extends OCSController {
$entries = [];
$user = $this->userSession->getUser()->getUID();
- $mounts = \OC_Mount_Config::getAbsoluteMountPoints($user);
+ $mounts = \OCA\Files_External\MountConfig::getAbsoluteMountPoints($user);
foreach ($mounts as $mountPoint => $mount) {
$entries[] = $this->formatMount($mountPoint, $mount);
}
diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php
index a3a2712520a..d92aa9e4169 100644
--- a/apps/files_external/lib/Controller/StoragesController.php
+++ b/apps/files_external/lib/Controller/StoragesController.php
@@ -250,7 +250,7 @@ abstract class StoragesController extends Controller {
$backend = $storage->getBackend();
// update status (can be time-consuming)
$storage->setStatus(
- \OC_Mount_Config::getBackendStatus(
+ \OCA\Files_External\MountConfig::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
false,
diff --git a/apps/files_external/lib/Lib/Backend/LegacyBackend.php b/apps/files_external/lib/Lib/Backend/LegacyBackend.php
index 87dabda8bb6..710f907608a 100644
--- a/apps/files_external/lib/Lib/Backend/LegacyBackend.php
+++ b/apps/files_external/lib/Lib/Backend/LegacyBackend.php
@@ -29,7 +29,7 @@ use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill;
use OCA\Files_External\Lib\MissingDependency;
/**
- * Legacy compatibility for OC_Mount_Config::registerBackend()
+ * Legacy compatibility for OCA\Files_External\MountConfig::registerBackend()
*/
class LegacyBackend extends Backend {
use LegacyDependencyCheckPolyfill {
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/MountConfig.php
index 745f2da6d5e..0257123b119 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/MountConfig.php
@@ -38,6 +38,8 @@
*
*/
+namespace OCA\Files_External;
+
use OCA\Files_External\AppInfo\Application;
use OCA\Files_External\Config\IConfigHandler;
use OCA\Files_External\Config\UserContext;
@@ -57,7 +59,7 @@ use phpseclib\Crypt\AES;
/**
* Class to configure mount.json globally and for users
*/
-class OC_Mount_Config {
+class MountConfig {
// TODO: make this class non-static and give it a proper namespace
public const MOUNT_TYPE_GLOBAL = 'global';
@@ -325,7 +327,7 @@ class OC_Mount_Config {
$backends = implode(', ', array_map(function ($backend) {
return '"' . $backend->getText() . '"';
}, $dependants));
- $message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>';
+ $message .= '<p>' . MountConfig::getSingleDependencyMessage($l, $module, $backends) . '</p>';
}
return $message;
diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php
index 95a7c47665d..2905e08883e 100644
--- a/apps/files_external/lib/Service/GlobalStoragesService.php
+++ b/apps/files_external/lib/Service/GlobalStoragesService.php
@@ -51,7 +51,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
$signal,
$storage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
['all']
);
return;
@@ -60,13 +60,13 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
$signal,
$storage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
$applicableUsers
);
$this->triggerApplicableHooks(
$signal,
$storage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_GROUP,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
$applicableGroups
);
}
@@ -100,7 +100,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_delete_mount,
$oldStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
['all']
);
}
@@ -109,7 +109,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_delete_mount,
$oldStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
$userDeletions
);
@@ -117,7 +117,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_delete_mount,
$oldStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_GROUP,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
$groupDeletions
);
@@ -125,7 +125,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_create_mount,
$newStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
$userAdditions
);
@@ -133,7 +133,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_create_mount,
$newStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_GROUP,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
$groupAdditions
);
@@ -145,7 +145,7 @@ class GlobalStoragesService extends StoragesService {
$this->triggerApplicableHooks(
Filesystem::signal_create_mount,
$newStorage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
['all']
);
}
diff --git a/apps/files_external/lib/Service/LegacyStoragesService.php b/apps/files_external/lib/Service/LegacyStoragesService.php
index fef746a35c0..faaf40ba028 100644
--- a/apps/files_external/lib/Service/LegacyStoragesService.php
+++ b/apps/files_external/lib/Service/LegacyStoragesService.php
@@ -83,13 +83,13 @@ abstract class LegacyStoragesService {
$storageOptions['priority'] = $backend->getPriority();
}
$storageConfig->setPriority($storageOptions['priority']);
- if ($mountType === \OC_Mount_Config::MOUNT_TYPE_USER) {
+ if ($mountType === \OCA\Files_External\MountConfig::MOUNT_TYPE_USER) {
$applicableUsers = $storageConfig->getApplicableUsers();
if ($applicable !== 'all') {
$applicableUsers[] = $applicable;
$storageConfig->setApplicableUsers($applicableUsers);
}
- } elseif ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
+ } elseif ($mountType === \OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP) {
$applicableGroups = $storageConfig->getApplicableGroups();
$applicableGroups[] = $applicable;
$storageConfig->setApplicableGroups($applicableGroups);
@@ -150,7 +150,7 @@ abstract class LegacyStoragesService {
$relativeMountPath = rtrim($parts[2], '/');
// note: we cannot do this after the loop because the decrypted config
// options might be needed for the config hash
- $storageOptions['options'] = \OC_Mount_Config::decryptPasswords($storageOptions['options']);
+ $storageOptions['options'] = \OCA\Files_External\MountConfig::decryptPasswords($storageOptions['options']);
if (!isset($storageOptions['backend'])) {
$storageOptions['backend'] = $storageOptions['class']; // legacy compat
}
@@ -168,7 +168,7 @@ abstract class LegacyStoragesService {
// but at this point we don't know the max-id, so use
// first group it by config hash
$storageOptions['mountpoint'] = $rootMountPath;
- $configId = \OC_Mount_Config::makeConfigHash($storageOptions);
+ $configId = \OCA\Files_External\MountConfig::makeConfigHash($storageOptions);
if (isset($storagesWithConfigHash[$configId])) {
$currentStorage = $storagesWithConfigHash[$configId];
}
diff --git a/apps/files_external/lib/Service/UserLegacyStoragesService.php b/apps/files_external/lib/Service/UserLegacyStoragesService.php
index 3ffd49863b9..ea3794384ba 100644
--- a/apps/files_external/lib/Service/UserLegacyStoragesService.php
+++ b/apps/files_external/lib/Service/UserLegacyStoragesService.php
@@ -51,6 +51,6 @@ class UserLegacyStoragesService extends LegacyStoragesService {
protected function readLegacyConfig() {
// read user config
$user = $this->userSession->getUser()->getUID();
- return \OC_Mount_Config::readData($user);
+ return \OCA\Files_External\MountConfig::readData($user);
}
}
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php
index 7b793ca819e..411a1a54dd6 100644
--- a/apps/files_external/lib/Service/UserStoragesService.php
+++ b/apps/files_external/lib/Service/UserStoragesService.php
@@ -78,7 +78,7 @@ class UserStoragesService extends StoragesService {
$this->triggerApplicableHooks(
$signal,
$storage->getMountPoint(),
- \OC_Mount_Config::MOUNT_TYPE_USER,
+ \OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
[$user]
);
}
diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php
index d3c2c07aa83..b0b1615b0eb 100644
--- a/apps/files_external/lib/Settings/Admin.php
+++ b/apps/files_external/lib/Settings/Admin.php
@@ -66,7 +66,7 @@ class Admin implements ISettings {
'storages' => $this->globalStoragesService->getStorages(),
'backends' => $this->backendService->getAvailableBackends(),
'authMechanisms' => $this->backendService->getAuthMechanisms(),
- 'dependencies' => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+ 'dependencies' => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()),
'allowUserMounting' => $this->backendService->isUserMountingAllowed(),
'globalCredentials' => $this->globalAuth->getAuth(''),
'globalCredentialsUid' => '',
diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php
index de94793a6af..b863d475148 100644
--- a/apps/files_external/lib/Settings/Personal.php
+++ b/apps/files_external/lib/Settings/Personal.php
@@ -74,7 +74,7 @@ class Personal implements ISettings {
'storages' => $this->userGlobalStoragesService->getStorages(),
'backends' => $this->backendService->getAvailableBackends(),
'authMechanisms' => $this->backendService->getAuthMechanisms(),
- 'dependencies' => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+ 'dependencies' => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()),
'allowUserMounting' => $this->backendService->isUserMountingAllowed(),
'globalCredentials' => $this->globalAuth->getAuth($uid),
'globalCredentialsUid' => $uid,