Sin descripción

KernelEvents.php 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel;
  11. /**
  12. * Contains all events thrown in the HttpKernel component.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. final class KernelEvents
  17. {
  18. /**
  19. * The REQUEST event occurs at the very beginning of request
  20. * dispatching.
  21. *
  22. * This event allows you to create a response for a request before any
  23. * other code in the framework is executed.
  24. *
  25. * @Event("Symfony\Component\HttpKernel\Event\RequestEvent")
  26. */
  27. public const REQUEST = 'kernel.request';
  28. /**
  29. * The EXCEPTION event occurs when an uncaught exception appears.
  30. *
  31. * This event allows you to create a response for a thrown exception or
  32. * to modify the thrown exception.
  33. *
  34. * @Event("Symfony\Component\HttpKernel\Event\ExceptionEvent")
  35. */
  36. public const EXCEPTION = 'kernel.exception';
  37. /**
  38. * The VIEW event occurs when the return value of a controller
  39. * is not a Response instance.
  40. *
  41. * This event allows you to create a response for the return value of the
  42. * controller.
  43. *
  44. * @Event("Symfony\Component\HttpKernel\Event\ViewEvent")
  45. */
  46. public const VIEW = 'kernel.view';
  47. /**
  48. * The CONTROLLER event occurs once a controller was found for
  49. * handling a request.
  50. *
  51. * This event allows you to change the controller that will handle the
  52. * request.
  53. *
  54. * @Event("Symfony\Component\HttpKernel\Event\ControllerEvent")
  55. */
  56. public const CONTROLLER = 'kernel.controller';
  57. /**
  58. * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved.
  59. *
  60. * This event allows you to change the arguments that will be passed to
  61. * the controller.
  62. *
  63. * @Event("Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent")
  64. */
  65. public const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments';
  66. /**
  67. * The RESPONSE event occurs once a response was created for
  68. * replying to a request.
  69. *
  70. * This event allows you to modify or replace the response that will be
  71. * replied.
  72. *
  73. * @Event("Symfony\Component\HttpKernel\Event\ResponseEvent")
  74. */
  75. public const RESPONSE = 'kernel.response';
  76. /**
  77. * The TERMINATE event occurs once a response was sent.
  78. *
  79. * This event allows you to run expensive post-response jobs.
  80. *
  81. * @Event("Symfony\Component\HttpKernel\Event\TerminateEvent")
  82. */
  83. public const TERMINATE = 'kernel.terminate';
  84. /**
  85. * The FINISH_REQUEST event occurs when a response was generated for a request.
  86. *
  87. * This event allows you to reset the global and environmental state of
  88. * the application, when it was changed during the request.
  89. *
  90. * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent")
  91. */
  92. public const FINISH_REQUEST = 'kernel.finish_request';
  93. }