KernelEvents.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. * @api
  17. */
  18. final class KernelEvents
  19. {
  20. /**
  21. * The REQUEST event occurs at the very beginning of request
  22. * dispatching.
  23. *
  24. * This event allows you to create a response for a request before any
  25. * other code in the framework is executed. The event listener method
  26. * receives a Symfony\Component\HttpKernel\Event\GetResponseEvent
  27. * instance.
  28. *
  29. * @Event
  30. *
  31. * @var string
  32. *
  33. * @api
  34. */
  35. const REQUEST = 'kernel.request';
  36. /**
  37. * The EXCEPTION event occurs when an uncaught exception appears.
  38. *
  39. * This event allows you to create a response for a thrown exception or
  40. * to modify the thrown exception. The event listener method receives
  41. * a Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
  42. * instance.
  43. *
  44. * @Event
  45. *
  46. * @var string
  47. *
  48. * @api
  49. */
  50. const EXCEPTION = 'kernel.exception';
  51. /**
  52. * The VIEW event occurs when the return value of a controller
  53. * is not a Response instance.
  54. *
  55. * This event allows you to create a response for the return value of the
  56. * controller. The event listener method receives a
  57. * Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
  58. * instance.
  59. *
  60. * @Event
  61. *
  62. * @var string
  63. *
  64. * @api
  65. */
  66. const VIEW = 'kernel.view';
  67. /**
  68. * The CONTROLLER event occurs once a controller was found for
  69. * handling a request.
  70. *
  71. * This event allows you to change the controller that will handle the
  72. * request. The event listener method receives a
  73. * Symfony\Component\HttpKernel\Event\FilterControllerEvent instance.
  74. *
  75. * @Event
  76. *
  77. * @var string
  78. *
  79. * @api
  80. */
  81. const CONTROLLER = 'kernel.controller';
  82. /**
  83. * The RESPONSE event occurs once a response was created for
  84. * replying to a request.
  85. *
  86. * This event allows you to modify or replace the response that will be
  87. * replied. The event listener method receives a
  88. * Symfony\Component\HttpKernel\Event\FilterResponseEvent instance.
  89. *
  90. * @Event
  91. *
  92. * @var string
  93. *
  94. * @api
  95. */
  96. const RESPONSE = 'kernel.response';
  97. /**
  98. * The TERMINATE event occurs once a response was sent.
  99. *
  100. * This event allows you to run expensive post-response jobs.
  101. * The event listener method receives a
  102. * Symfony\Component\HttpKernel\Event\PostResponseEvent instance.
  103. *
  104. * @Event
  105. *
  106. * @var string
  107. */
  108. const TERMINATE = 'kernel.terminate';
  109. /**
  110. * The FINISH_REQUEST event occurs when a response was generated for a request.
  111. *
  112. * This event allows you to reset the global and environmental state of
  113. * the application, when it was changed during the request.
  114. *
  115. * @var string
  116. */
  117. const FINISH_REQUEST = 'kernel.finish_request';
  118. }