Local.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Robin McCorkell <robin@mccorkell.me.uk>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCA\Files_External\Lib\Backend;
  25. use OCA\Files_External\Lib\Auth\AuthMechanism;
  26. use OCA\Files_External\Lib\Auth\NullMechanism;
  27. use OCA\Files_External\Lib\DefinitionParameter;
  28. use OCA\Files_External\Service\BackendService;
  29. use OCP\IL10N;
  30. class Local extends Backend {
  31. public function __construct(IL10N $l, NullMechanism $legacyAuth) {
  32. $this
  33. ->setIdentifier('local')
  34. ->addIdentifierAlias('\OC\Files\Storage\Local') // legacy compat
  35. ->setStorageClass('\OC\Files\Storage\Local')
  36. ->setText($l->t('Local'))
  37. ->addParameters([
  38. new DefinitionParameter('datadir', $l->t('Location')),
  39. ])
  40. ->setAllowedVisibility(BackendService::VISIBILITY_ADMIN)
  41. ->setPriority(BackendService::PRIORITY_DEFAULT + 50)
  42. ->addAuthScheme(AuthMechanism::SCHEME_NULL)
  43. ->setLegacyAuthMechanism($legacyAuth)
  44. ;
  45. }
  46. }