1
0

InstanceFactory.php 639 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Remote;
  7. use OCP\Http\Client\IClientService;
  8. use OCP\ICache;
  9. use OCP\Remote\IInstanceFactory;
  10. class InstanceFactory implements IInstanceFactory {
  11. /** @var ICache */
  12. private $cache;
  13. /** @var IClientService */
  14. private $clientService;
  15. public function __construct(ICache $cache, IClientService $clientService) {
  16. $this->cache = $cache;
  17. $this->clientService = $clientService;
  18. }
  19. public function getInstance($url) {
  20. return new Instance($url, $this->cache, $this->clientService);
  21. }
  22. }