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