EventSourceFactory.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2023 Daniel Kesselberg <mail@danielkesselberg.de>
  4. *
  5. * @author Daniel Kesselberg <mail@danielkesselberg.de>
  6. *
  7. * @license AGPL-3.0-or-later
  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 OC;
  23. use OCP\IEventSource;
  24. use OCP\IEventSourceFactory;
  25. use OCP\IRequest;
  26. class EventSourceFactory implements IEventSourceFactory {
  27. private IRequest $request;
  28. public function __construct(IRequest $request) {
  29. $this->request = $request;
  30. }
  31. /**
  32. * Create a new event source
  33. *
  34. * @return IEventSource
  35. * @since 28.0.0
  36. */
  37. public function create(): IEventSource {
  38. return new \OC_EventSource($this->request);
  39. }
  40. }