HttpApplicationInterface.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  10. * @link https://cakephp.org CakePHP(tm) Project
  11. * @since 3.5.0
  12. * @license https://opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace Cake\Core;
  15. use Psr\Http\Message\ResponseInterface;
  16. use Psr\Http\Message\ServerRequestInterface;
  17. /**
  18. * An interface defining the methods that the
  19. * http server depend on.
  20. */
  21. interface HttpApplicationInterface
  22. {
  23. /**
  24. * Load all the application configuration and bootstrap logic.
  25. *
  26. * Override this method to add additional bootstrap logic for your application.
  27. *
  28. * @return void
  29. */
  30. public function bootstrap();
  31. /**
  32. * Define the routes for an application.
  33. *
  34. * Use the provided RouteBuilder to define an application's routing.
  35. *
  36. * @param \Cake\Routing\RouteBuilder $routes A route builder to add routes into.
  37. * @return void
  38. */
  39. public function routes($routes);
  40. /**
  41. * Define the HTTP middleware layers for an application.
  42. *
  43. * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to set in your App Class
  44. * @return \Cake\Http\MiddlewareQueue
  45. */
  46. public function middleware($middleware);
  47. /**
  48. * Invoke the application.
  49. *
  50. * @param \Psr\Http\Message\ServerRequestInterface $request The request
  51. * @param \Psr\Http\Message\ResponseInterface $response The response
  52. * @param callable $next The next middleware
  53. * @return \Psr\Http\Message\ResponseInterface
  54. */
  55. public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next);
  56. }