application.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @author Roeland Jago Douma <rullzer@owncloud.com>
  4. * @author Victor Dubiniuk <dubiniuk@owncloud.com>
  5. *
  6. * @copyright Copyright (c) 2016, ownCloud, Inc.
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCA\Files_Trashbin\AppInfo;
  23. use OCP\AppFramework\App;
  24. use OCA\Files_Trashbin\Expiration;
  25. class Application extends App {
  26. public function __construct (array $urlParams = []) {
  27. parent::__construct('files_trashbin', $urlParams);
  28. $container = $this->getContainer();
  29. /*
  30. * Register capabilities
  31. */
  32. $container->registerCapability('OCA\Files_Trashbin\Capabilities');
  33. /*
  34. * Register expiration
  35. */
  36. $container->registerService('Expiration', function($c) {
  37. return new Expiration(
  38. $c->query('ServerContainer')->getConfig(),
  39. $c->query('OCP\AppFramework\Utility\ITimeFactory')
  40. );
  41. });
  42. }
  43. }