You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Application.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  7. * @author Christoph Wurst <christoph@owncloud.com>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Lukas Reschke <lukas@statuscode.ch>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Roeland Jago Douma <roeland@famdouma.nl>
  12. * @author Thomas Müller <thomas.mueller@tmit.eu>
  13. * @author Victor Dubiniuk <dubiniuk@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. namespace OC\Core;
  31. use OC\Security\IdentityProof\Manager;
  32. use OCP\AppFramework\App;
  33. use OC\Core\Controller\CssController;
  34. use OCP\AppFramework\Utility\ITimeFactory;
  35. use OCP\IRequest;
  36. use OCP\Util;
  37. /**
  38. * Class Application
  39. *
  40. * @package OC\Core
  41. */
  42. class Application extends App {
  43. public function __construct() {
  44. parent::__construct('core');
  45. $container = $this->getContainer();
  46. $container->registerService('defaultMailAddress', function () {
  47. return Util::getDefaultEmailAddress('lostpassword-noreply');
  48. });
  49. $container->registerService(Manager::class, function () {
  50. return new Manager(
  51. \OC::$server->getAppDataDir('identityproof'),
  52. \OC::$server->getCrypto()
  53. );
  54. });
  55. $container->registerService(CssController::class, function () use ($container) {
  56. return new CssController(
  57. $container->query('appName'),
  58. $container->query(IRequest::class),
  59. \OC::$server->getAppDataDir('css'),
  60. $container->query(ITimeFactory::class)
  61. );
  62. });
  63. }
  64. }