説明なし

KernelEvents.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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\GetResponseEvent")
  26. *
  27. * @var string
  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.
  35. *
  36. * @Event("Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent")
  37. *
  38. * @var string
  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.
  47. *
  48. * @Event("Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent")
  49. *
  50. * @var string
  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.
  59. *
  60. * @Event("Symfony\Component\HttpKernel\Event\FilterControllerEvent")
  61. *
  62. * @var string
  63. */
  64. const CONTROLLER = 'kernel.controller';
  65. /**
  66. * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved.
  67. *
  68. * This event allows you to change the arguments that will be passed to
  69. * the controller.
  70. *
  71. * @Event("Symfony\Component\HttpKernel\Event\FilterControllerArgumentsEvent")
  72. *
  73. * @var string
  74. */
  75. const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments';
  76. /**
  77. * The RESPONSE event occurs once a response was created for
  78. * replying to a request.
  79. *
  80. * This event allows you to modify or replace the response that will be
  81. * replied.
  82. *
  83. * @Event("Symfony\Component\HttpKernel\Event\FilterResponseEvent")
  84. *
  85. * @var string
  86. */
  87. const RESPONSE = 'kernel.response';
  88. /**
  89. * The TERMINATE event occurs once a response was sent.
  90. *
  91. * This event allows you to run expensive post-response jobs.
  92. *
  93. * @Event("Symfony\Component\HttpKernel\Event\PostResponseEvent")
  94. *
  95. * @var string
  96. */
  97. const TERMINATE = 'kernel.terminate';
  98. /**
  99. * The FINISH_REQUEST event occurs when a response was generated for a request.
  100. *
  101. * This event allows you to reset the global and environmental state of
  102. * the application, when it was changed during the request.
  103. *
  104. * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent")
  105. *
  106. * @var string
  107. */
  108. const FINISH_REQUEST = 'kernel.finish_request';
  109. }