1
|
<?php
|
2
|
|
3
|
/*
|
4
|
* This file is part of the Symfony package.
|
5
|
*
|
6
|
* (c) Fabien Potencier <fabien@symfony.com>
|
7
|
*
|
8
|
* For the full copyright and license information, please view the LICENSE
|
9
|
* file that was distributed with this source code.
|
10
|
*/
|
11
|
|
12
|
namespace Symfony\Component\HttpKernel;
|
13
|
|
14
|
/**
|
15
|
* Contains all events thrown in the HttpKernel component.
|
16
|
*
|
17
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
18
|
*/
|
19
|
final class KernelEvents
|
20
|
{
|
21
|
/**
|
22
|
* The REQUEST event occurs at the very beginning of request
|
23
|
* dispatching.
|
24
|
*
|
25
|
* This event allows you to create a response for a request before any
|
26
|
* other code in the framework is executed. The event listener method
|
27
|
* receives a Symfony\Component\HttpKernel\Event\GetResponseEvent
|
28
|
* instance.
|
29
|
*
|
30
|
* @Event
|
31
|
*
|
32
|
* @var string
|
33
|
*/
|
34
|
const REQUEST = 'kernel.request';
|
35
|
|
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
|
const EXCEPTION = 'kernel.exception';
|
49
|
|
50
|
/**
|
51
|
* The VIEW event occurs when the return value of a controller
|
52
|
* is not a Response instance.
|
53
|
*
|
54
|
* This event allows you to create a response for the return value of the
|
55
|
* controller. The event listener method receives a
|
56
|
* Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
|
57
|
* instance.
|
58
|
*
|
59
|
* @Event
|
60
|
*
|
61
|
* @var string
|
62
|
*/
|
63
|
const VIEW = 'kernel.view';
|
64
|
|
65
|
/**
|
66
|
* The CONTROLLER event occurs once a controller was found for
|
67
|
* handling a request.
|
68
|
*
|
69
|
* This event allows you to change the controller that will handle the
|
70
|
* request. The event listener method receives a
|
71
|
* Symfony\Component\HttpKernel\Event\FilterControllerEvent instance.
|
72
|
*
|
73
|
* @Event
|
74
|
*
|
75
|
* @var string
|
76
|
*/
|
77
|
const CONTROLLER = 'kernel.controller';
|
78
|
|
79
|
/**
|
80
|
* The RESPONSE event occurs once a response was created for
|
81
|
* replying to a request.
|
82
|
*
|
83
|
* This event allows you to modify or replace the response that will be
|
84
|
* replied. The event listener method receives a
|
85
|
* Symfony\Component\HttpKernel\Event\FilterResponseEvent instance.
|
86
|
*
|
87
|
* @Event
|
88
|
*
|
89
|
* @var string
|
90
|
*/
|
91
|
const RESPONSE = 'kernel.response';
|
92
|
|
93
|
/**
|
94
|
* The TERMINATE event occurs once a response was sent.
|
95
|
*
|
96
|
* This event allows you to run expensive post-response jobs.
|
97
|
* The event listener method receives a
|
98
|
* Symfony\Component\HttpKernel\Event\PostResponseEvent instance.
|
99
|
*
|
100
|
* @Event
|
101
|
*
|
102
|
* @var string
|
103
|
*/
|
104
|
const TERMINATE = 'kernel.terminate';
|
105
|
|
106
|
/**
|
107
|
* The FINISH_REQUEST event occurs when a response was generated for a request.
|
108
|
*
|
109
|
* This event allows you to reset the global and environmental state of
|
110
|
* the application, when it was changed during the request.
|
111
|
* The event listener method receives a
|
112
|
* Symfony\Component\HttpKernel\Event\FinishRequestEvent instance.
|
113
|
*
|
114
|
* @Event
|
115
|
*
|
116
|
* @var string
|
117
|
*/
|
118
|
const FINISH_REQUEST = 'kernel.finish_request';
|
119
|
}
|