diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-12 20:03:11 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-19 10:05:11 +0100 |
commit | 1eeca031f863a652d07ebfa2f75339232bf60dc1 (patch) | |
tree | 2f4b046e3506d4e9e385415bf01961f9b9978d97 /apps/files_external/lib/auth | |
parent | 272a46ebe1a5e195a078dde74f5f2ad941923d9e (diff) | |
download | nextcloud-server-1eeca031f863a652d07ebfa2f75339232bf60dc1.tar.gz nextcloud-server-1eeca031f863a652d07ebfa2f75339232bf60dc1.zip |
Split backend identifiers from the class name
Prior to this, the storage class name was stored in mount.json under the
"class" parameter, and the auth mechanism class name under the
"authMechanism" parameter. This decouples the class name from the
identifier used to retrieve the backend or auth mechanism.
Now, backends/auth mechanisms have a unique identifier, which is saved in
the "backend" or "authMechanism" parameter in mount.json respectively.
An identifier is considered unique for the object it references, but the
underlying class may change (e.g. files_external gets pulled into core
and namespaces are modified).
Diffstat (limited to 'apps/files_external/lib/auth')
-rw-r--r-- | apps/files_external/lib/auth/authmechanism.php | 9 | ||||
-rw-r--r-- | apps/files_external/lib/auth/nullmechanism.php | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/apps/files_external/lib/auth/authmechanism.php b/apps/files_external/lib/auth/authmechanism.php index 7da57662db8..a89ee823d51 100644 --- a/apps/files_external/lib/auth/authmechanism.php +++ b/apps/files_external/lib/auth/authmechanism.php @@ -23,6 +23,7 @@ namespace OCA\Files_External\Lib\Auth; use \OCA\Files_External\Lib\StorageConfig; use \OCA\Files_External\Lib\VisibilityTrait; +use \OCA\Files_External\Lib\IdentifierTrait; use \OCA\Files_External\Lib\FrontendDefinitionTrait; use \OCA\Files_External\Lib\StorageModifierTrait; @@ -59,18 +60,12 @@ class AuthMechanism implements \JsonSerializable { use VisibilityTrait; use FrontendDefinitionTrait; use StorageModifierTrait; + use IdentifierTrait; /** @var string */ protected $scheme; /** - * @return string - */ - public function getClass() { - return '\\'.get_class($this); - } - - /** * Get the authentication scheme implemented * See self::SCHEME_* constants * diff --git a/apps/files_external/lib/auth/nullmechanism.php b/apps/files_external/lib/auth/nullmechanism.php index 396649d7319..1765fc67396 100644 --- a/apps/files_external/lib/auth/nullmechanism.php +++ b/apps/files_external/lib/auth/nullmechanism.php @@ -32,6 +32,7 @@ class NullMechanism extends AuthMechanism { public function __construct(IL10N $l) { $this + ->setIdentifier('null::null') ->setScheme(self::SCHEME_NULL) ->setText($l->t('None')) ; |