Copy of Nextcloud richdocuments app, but with modifications so all traffic goes over clearnet/CJDNS/Tor/I2P/whatever instead of having a single default hostname.
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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * ownCloud - Richdocuments App
  4. *
  5. * @author Victor Dubiniuk
  6. * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
  7. *
  8. * This file is licensed under the Affero General Public License version 3 or
  9. * later.
  10. */
  11. namespace OCA\Richdocuments\AppInfo;
  12. use \OCP\AppFramework\App;
  13. use \OCA\Richdocuments\Controller\UserController;
  14. use \OCA\Richdocuments\Controller\SessionController;
  15. use \OCA\Richdocuments\Controller\DocumentController;
  16. use \OCA\Richdocuments\Controller\SettingsController;
  17. use \OCA\Richdocuments\AppConfig;
  18. class Application extends App {
  19. public function __construct (array $urlParams = array()) {
  20. parent::__construct('richdocuments', $urlParams);
  21. $container = $this->getContainer();
  22. /**
  23. * Controllers
  24. */
  25. $container->registerService('UserController', function($c) {
  26. return new UserController(
  27. $c->query('AppName'),
  28. $c->query('Request')
  29. );
  30. });
  31. $container->registerService('SessionController', function($c) {
  32. return new SessionController(
  33. $c->query('AppName'),
  34. $c->query('Request'),
  35. $c->query('Logger'),
  36. $c->query('UserId')
  37. );
  38. });
  39. $container->registerService('DocumentController', function($c) {
  40. return new DocumentController(
  41. $c->query('AppName'),
  42. $c->query('Request'),
  43. $c->query('CoreConfig'),
  44. $c->query('AppConfig'),
  45. $c->query('L10N'),
  46. $c->query('UserId'),
  47. $c->query('ICacheFactory'),
  48. $c->query('Logger')
  49. );
  50. });
  51. $container->registerService('SettingsController', function($c) {
  52. return new SettingsController(
  53. $c->query('AppName'),
  54. $c->query('Request'),
  55. $c->query('L10N'),
  56. $c->query('AppConfig'),
  57. $c->query('UserId')
  58. );
  59. });
  60. $container->registerService('AppConfig', function($c) {
  61. return new AppConfig(
  62. $c->query('CoreConfig')
  63. );
  64. });
  65. /**
  66. * Core
  67. */
  68. $container->registerService('Logger', function($c) {
  69. return $c->query('ServerContainer')->getLogger();
  70. });
  71. $container->registerService('CoreConfig', function($c) {
  72. return $c->query('ServerContainer')->getConfig();
  73. });
  74. $container->registerService('L10N', function($c) {
  75. return $c->query('ServerContainer')->getL10N($c->query('AppName'));
  76. });
  77. $container->registerService('UserId', function($c) {
  78. $user = $c->query('ServerContainer')->getUserSession()->getUser();
  79. $uid = is_null($user) ? '' : $user->getUID();
  80. return $uid;
  81. });
  82. $container->registerService('ICacheFactory', function($c) {
  83. return $c->query('ServerContainer')->getMemCacheFactory();
  84. });
  85. }
  86. }