app.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
  8. * @author j-ed <juergen@eisfair.org>
  9. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Robin Appelman <robin@icewind.nl>
  12. * @author Robin McCorkell <robin@mccorkell.me.uk>
  13. * @author Vincent Petry <pvince81@owncloud.com>
  14. *
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. use OCA\Files_External\Config\ConfigAdapter;
  31. OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
  32. require_once __DIR__ . '/../3rdparty/autoload.php';
  33. // register Application object singleton
  34. \OC_Mount_Config::$app = \OC::$server->query(\OCA\Files_External\AppInfo\Application::class);
  35. \OC_Mount_Config::$app->registerListeners();
  36. $appContainer = \OC_Mount_Config::$app->getContainer();
  37. \OCA\Files\App::getNavigationManager()->add(function () {
  38. $l = \OC::$server->getL10N('files_external');
  39. return [
  40. 'id' => 'extstoragemounts',
  41. 'appname' => 'files_external',
  42. 'script' => 'list.php',
  43. 'order' => 30,
  44. 'name' => $l->t('External storages'),
  45. ];
  46. });
  47. $mountProvider = $appContainer->query(ConfigAdapter::class);
  48. \OC::$server->getMountProviderCollection()->registerProvider($mountProvider);