RouteActionHandler.php 793 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\AppFramework\Routing;
  8. use OC\AppFramework\App;
  9. use OC\AppFramework\DependencyInjection\DIContainer;
  10. class RouteActionHandler {
  11. private $controllerName;
  12. private $actionName;
  13. private $container;
  14. /**
  15. * @param string $controllerName
  16. * @param string $actionName
  17. */
  18. public function __construct(DIContainer $container, $controllerName, $actionName) {
  19. $this->controllerName = $controllerName;
  20. $this->actionName = $actionName;
  21. $this->container = $container;
  22. }
  23. public function __invoke($params) {
  24. App::main($this->controllerName, $this->actionName, $this->container, $params);
  25. }
  26. }