KernelEvents.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. The event listener method
  24. * receives a Symfony\Component\HttpKernel\Event\GetResponseEvent
  25. * instance.
  26. *
  27. * @Event
  28. */
  29. const REQUEST = 'kernel.request';
  30. /**
  31. * The EXCEPTION event occurs when an uncaught exception appears.
  32. *
  33. * This event allows you to create a response for a thrown exception or
  34. * to modify the thrown exception. The event listener method receives
  35. * a Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
  36. * instance.
  37. *
  38. * @Event
  39. */
  40. const EXCEPTION = 'kernel.exception';
  41. /**
  42. * The VIEW event occurs when the return value of a controller
  43. * is not a Response instance.
  44. *
  45. * This event allows you to create a response for the return value of the
  46. * controller. The event listener method receives a
  47. * Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
  48. * instance.
  49. *
  50. * @Event
  51. */
  52. const VIEW = 'kernel.view';
  53. /**
  54. * The CONTROLLER event occurs once a controller was found for
  55. * handling a request.
  56. *
  57. * This event allows you to change the controller that will handle the
  58. * request. The event listener method receives a
  59. * Symfony\Component\HttpKernel\Event\FilterControllerEvent instance.
  60. *
  61. * @Event
  62. */
  63. const CONTROLLER = 'kernel.controller';
  64. /**
  65. * The RESPONSE event occurs once a response was created for
  66. * replying to a request.
  67. *
  68. * This event allows you to modify or replace the response that will be
  69. * replied. The event listener method receives a
  70. * Symfony\Component\HttpKernel\Event\FilterResponseEvent instance.
  71. *
  72. * @Event
  73. */
  74. const RESPONSE = 'kernel.response';
  75. /**
  76. * The TERMINATE event occurs once a response was sent.
  77. *
  78. * This event allows you to run expensive post-response jobs.
  79. * The event listener method receives a
  80. * Symfony\Component\HttpKernel\Event\PostResponseEvent instance.
  81. *
  82. * @Event
  83. */
  84. const TERMINATE = 'kernel.terminate';
  85. /**
  86. * The FINISH_REQUEST event occurs when a response was generated for a request.
  87. *
  88. * This event allows you to reset the global and environmental state of
  89. * the application, when it was changed during the request.
  90. * The event listener method receives a
  91. * Symfony\Component\HttpKernel\Event\FinishRequestEvent instance.
  92. *
  93. * @Event
  94. */
  95. const FINISH_REQUEST = 'kernel.finish_request';
  96. }