|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Facades for Yii 2 |
|
4
|
|
|
* |
|
5
|
|
|
* Generated on Yii 2.0.12 |
|
6
|
|
|
* |
|
7
|
|
|
* @see https://github.com/sergeymakinen/yii2-facades |
|
8
|
|
|
* @copyright Copyright (c) 2016-2017 Sergey Makinen (https://makinen.ru) |
|
9
|
|
|
* @license https://github.com/sergeymakinen/yii2-facades/blob/master/LICENSE The MIT License |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace sergeymakinen\facades; |
|
13
|
|
|
|
|
14
|
|
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */ |
|
15
|
|
|
/** |
|
16
|
|
|
* Yii::$app->get('errorHandler') facade. |
|
17
|
|
|
* |
|
18
|
|
|
* Methods |
|
19
|
|
|
* |
|
20
|
|
|
* @method static string addTypeLinks(string $code) Adds informational links to the given PHP type/class. |
|
21
|
|
|
* @see \yii\web\ErrorHandler::addTypeLinks |
|
22
|
|
|
* |
|
23
|
|
|
* @method static string argumentsToString(array $args) Converts arguments array to its string representation. |
|
24
|
|
|
* @see \yii\web\ErrorHandler::argumentsToString |
|
25
|
|
|
* |
|
26
|
|
|
* @method static \yii\base\Behavior attachBehavior(string $name, string|array|\yii\base\Behavior $behavior) Attaches a behavior to this component. |
|
27
|
|
|
* @see \yii\base\Component::attachBehavior |
|
28
|
|
|
* |
|
29
|
|
|
* @method static void attachBehaviors(array $behaviors) Attaches a list of behaviors to the component. |
|
30
|
|
|
* @see \yii\base\Component::attachBehaviors |
|
31
|
|
|
* |
|
32
|
|
|
* @method static array behaviors() Returns a list of behaviors that this component should behave as. |
|
33
|
|
|
* @see \yii\base\Component::behaviors |
|
34
|
|
|
* |
|
35
|
|
|
* @method static void clearOutput() Removes all output echoed before calling this method. |
|
36
|
|
|
* @see \yii\base\ErrorHandler::clearOutput |
|
37
|
|
|
* |
|
38
|
|
|
* @method static void convertExceptionToError(\Exception $exception) Converts an exception into a PHP error. |
|
39
|
|
|
* @see \yii\base\ErrorHandler::convertExceptionToError |
|
40
|
|
|
* |
|
41
|
|
|
* @method static string convertExceptionToString(\Exception|\Error $exception) Converts an exception into a simple string. |
|
42
|
|
|
* @see \yii\base\ErrorHandler::convertExceptionToString |
|
43
|
|
|
* |
|
44
|
|
|
* @method static string createFrameworkVersionLink() Creates string containing HTML link which refers to the page with the current version of the framework and version number text. |
|
45
|
|
|
* @see \yii\web\ErrorHandler::createFrameworkVersionLink |
|
46
|
|
|
* |
|
47
|
|
|
* @method static string createHttpStatusLink(int $statusCode, string $statusDescription) Creates HTML containing link to the page with the information on given HTTP status code. |
|
48
|
|
|
* @see \yii\web\ErrorHandler::createHttpStatusLink |
|
49
|
|
|
* |
|
50
|
|
|
* @method static string createServerInformationLink() Creates string containing HTML link which refers to the home page of determined web-server software and its full name. |
|
51
|
|
|
* @see \yii\web\ErrorHandler::createServerInformationLink |
|
52
|
|
|
* |
|
53
|
|
|
* @method static null|\yii\base\Behavior detachBehavior(string $name) Detaches a behavior from the component. |
|
54
|
|
|
* @see \yii\base\Component::detachBehavior |
|
55
|
|
|
* |
|
56
|
|
|
* @method static void detachBehaviors() Detaches all behaviors from the component. |
|
57
|
|
|
* @see \yii\base\Component::detachBehaviors |
|
58
|
|
|
* |
|
59
|
|
|
* @method static void ensureBehaviors() Makes sure that the behaviors declared in [[behaviors()]] are attached to this component. |
|
60
|
|
|
* @see \yii\base\Component::ensureBehaviors |
|
61
|
|
|
* |
|
62
|
|
|
* @method static null|\yii\base\Behavior getBehavior(string $name) Returns the named behavior object. |
|
63
|
|
|
* @see \yii\base\Component::getBehavior |
|
64
|
|
|
* |
|
65
|
|
|
* @method static \yii\base\Behavior[] getBehaviors() Returns all behaviors attached to this component. |
|
66
|
|
|
* @see \yii\base\Component::getBehaviors |
|
67
|
|
|
* |
|
68
|
|
|
* @method static string getExceptionName(\Exception $exception) Returns human-readable exception name. |
|
69
|
|
|
* @see \yii\web\ErrorHandler::getExceptionName |
|
70
|
|
|
* |
|
71
|
|
|
* @method static bool handleError(int $code, string $message, string $file, int $line) Handles PHP execution errors such as warnings and notices. |
|
72
|
|
|
* @see \yii\base\ErrorHandler::handleError |
|
73
|
|
|
* |
|
74
|
|
|
* @method static void handleException(\Exception $exception) Handles uncaught PHP exceptions. |
|
75
|
|
|
* @see \yii\base\ErrorHandler::handleException |
|
76
|
|
|
* |
|
77
|
|
|
* @method static void handleFatalError() Handles fatal PHP errors. |
|
78
|
|
|
* @see \yii\base\ErrorHandler::handleFatalError |
|
79
|
|
|
* |
|
80
|
|
|
* @method static bool handleHhvmError(int $code, string $message, string $file, int $line, mixed $context, mixed $backtrace) Handles HHVM execution errors such as warnings and notices. |
|
81
|
|
|
* @see \yii\base\ErrorHandler::handleHhvmError |
|
82
|
|
|
* |
|
83
|
|
|
* @method static bool hasEventHandlers(string $name) Returns a value indicating whether there is any handler attached to the named event. |
|
84
|
|
|
* @see \yii\base\Component::hasEventHandlers |
|
85
|
|
|
* |
|
86
|
|
|
* @method static string htmlEncode(string $text) Converts special characters to HTML entities. |
|
87
|
|
|
* @see \yii\web\ErrorHandler::htmlEncode |
|
88
|
|
|
* |
|
89
|
|
|
* @method static bool isCoreFile(string $file) Determines whether given name of the file belongs to the framework. |
|
90
|
|
|
* @see \yii\web\ErrorHandler::isCoreFile |
|
91
|
|
|
* |
|
92
|
|
|
* @method static void logException(\Exception $exception) Logs the given exception. |
|
93
|
|
|
* @see \yii\base\ErrorHandler::logException |
|
94
|
|
|
* |
|
95
|
|
|
* @method static bool off(string $name, callable $handler = null) Detaches an existing event handler from this component. |
|
96
|
|
|
* @see \yii\base\Component::off |
|
97
|
|
|
* |
|
98
|
|
|
* @method static void on(string $name, callable $handler, mixed $data = null, bool $append = true) Attaches an event handler to an event. |
|
99
|
|
|
* @see \yii\base\Component::on |
|
100
|
|
|
* |
|
101
|
|
|
* @method static void register() Register this error handler. |
|
102
|
|
|
* @see \yii\base\ErrorHandler::register |
|
103
|
|
|
* |
|
104
|
|
|
* @method static string renderCallStack(\Exception|\ParseError $exception) Renders call stack. |
|
105
|
|
|
* @see \yii\web\ErrorHandler::renderCallStack |
|
106
|
|
|
* |
|
107
|
|
|
* @method static string renderCallStackItem(string|null $file, int|null $line, string|null $class, string|null $method, array $args, int $index) Renders a single call stack element. |
|
108
|
|
|
* @see \yii\web\ErrorHandler::renderCallStackItem |
|
109
|
|
|
* |
|
110
|
|
|
* @method static string renderFile(string $_file_, array $_params_) Renders a view file as a PHP script. |
|
111
|
|
|
* @see \yii\web\ErrorHandler::renderFile |
|
112
|
|
|
* |
|
113
|
|
|
* @method static string renderPreviousExceptions(\Exception $exception) Renders the previous exception stack for a given Exception. |
|
114
|
|
|
* @see \yii\web\ErrorHandler::renderPreviousExceptions |
|
115
|
|
|
* |
|
116
|
|
|
* @method static string renderRequest() Renders the global variables of the request. |
|
117
|
|
|
* @see \yii\web\ErrorHandler::renderRequest |
|
118
|
|
|
* |
|
119
|
|
|
* @method static void trigger(string $name, \yii\base\Event $event = null) Triggers an event. |
|
120
|
|
|
* @see \yii\base\Component::trigger |
|
121
|
|
|
* |
|
122
|
|
|
* @method static void unregister() Unregisters this error handler by restoring the PHP error and exception handlers. |
|
123
|
|
|
* @see \yii\base\ErrorHandler::unregister |
|
124
|
|
|
* |
|
125
|
|
|
* Property accessors |
|
126
|
|
|
* |
|
127
|
|
|
* @method static string getCallStackItemView() Returns the path of the view file for rendering exceptions and errors call stack element. |
|
128
|
|
|
* @see \yii\web\ErrorHandler::callStackItemView |
|
129
|
|
|
* |
|
130
|
|
|
* @method static bool getDiscardExistingOutput() Returns whether to discard any existing page output before error display. |
|
131
|
|
|
* @see \yii\base\ErrorHandler::discardExistingOutput |
|
132
|
|
|
* |
|
133
|
|
|
* @method static array getDisplayVars() Returns list of the PHP predefined variables that should be displayed on the error page. |
|
134
|
|
|
* @see \yii\web\ErrorHandler::displayVars |
|
135
|
|
|
* |
|
136
|
|
|
* @method static string getErrorAction() Returns the route (e.g. `site/error`) to the controller action that will be used to display external errors. |
|
137
|
|
|
* @see \yii\web\ErrorHandler::errorAction |
|
138
|
|
|
* |
|
139
|
|
|
* @method static string getErrorView() Returns the path of the view file for rendering exceptions without call stack information. |
|
140
|
|
|
* @see \yii\web\ErrorHandler::errorView |
|
141
|
|
|
* |
|
142
|
|
|
* @method static \Exception|null getException() Returns the exception that is being handled currently. |
|
143
|
|
|
* @see \yii\base\ErrorHandler::exception |
|
144
|
|
|
* |
|
145
|
|
|
* @method static string getExceptionView() Returns the path of the view file for rendering exceptions. |
|
146
|
|
|
* @see \yii\web\ErrorHandler::exceptionView |
|
147
|
|
|
* |
|
148
|
|
|
* @method static int getMaxSourceLines() Returns maximum number of source code lines to be displayed. |
|
149
|
|
|
* @see \yii\web\ErrorHandler::maxSourceLines |
|
150
|
|
|
* |
|
151
|
|
|
* @method static int getMaxTraceSourceLines() Returns maximum number of trace source code lines to be displayed. |
|
152
|
|
|
* @see \yii\web\ErrorHandler::maxTraceSourceLines |
|
153
|
|
|
* |
|
154
|
|
|
* @method static int getMemoryReserveSize() Returns the size of the reserved memory. |
|
155
|
|
|
* @see \yii\base\ErrorHandler::memoryReserveSize |
|
156
|
|
|
* |
|
157
|
|
|
* @method static string getPreviousExceptionView() Returns the path of the view file for rendering previous exceptions. |
|
158
|
|
|
* @see \yii\web\ErrorHandler::previousExceptionView |
|
159
|
|
|
* |
|
160
|
|
|
* @method static void setCallStackItemView(string $value) Sets the path of the view file for rendering exceptions and errors call stack element. |
|
161
|
|
|
* @see \yii\web\ErrorHandler::callStackItemView |
|
162
|
|
|
* |
|
163
|
|
|
* @method static void setDiscardExistingOutput(bool $value) Sets whether to discard any existing page output before error display. |
|
164
|
|
|
* @see \yii\base\ErrorHandler::discardExistingOutput |
|
165
|
|
|
* |
|
166
|
|
|
* @method static void setDisplayVars(array $value) Sets list of the PHP predefined variables that should be displayed on the error page. |
|
167
|
|
|
* @see \yii\web\ErrorHandler::displayVars |
|
168
|
|
|
* |
|
169
|
|
|
* @method static void setErrorAction(string $value) Sets the route (e.g. `site/error`) to the controller action that will be used to display external errors. |
|
170
|
|
|
* @see \yii\web\ErrorHandler::errorAction |
|
171
|
|
|
* |
|
172
|
|
|
* @method static void setErrorView(string $value) Sets the path of the view file for rendering exceptions without call stack information. |
|
173
|
|
|
* @see \yii\web\ErrorHandler::errorView |
|
174
|
|
|
* |
|
175
|
|
|
* @method static void setException(\Exception|null $value) Sets the exception that is being handled currently. |
|
176
|
|
|
* @see \yii\base\ErrorHandler::exception |
|
177
|
|
|
* |
|
178
|
|
|
* @method static void setExceptionView(string $value) Sets the path of the view file for rendering exceptions. |
|
179
|
|
|
* @see \yii\web\ErrorHandler::exceptionView |
|
180
|
|
|
* |
|
181
|
|
|
* @method static void setMaxSourceLines(int $value) Sets maximum number of source code lines to be displayed. |
|
182
|
|
|
* @see \yii\web\ErrorHandler::maxSourceLines |
|
183
|
|
|
* |
|
184
|
|
|
* @method static void setMaxTraceSourceLines(int $value) Sets maximum number of trace source code lines to be displayed. |
|
185
|
|
|
* @see \yii\web\ErrorHandler::maxTraceSourceLines |
|
186
|
|
|
* |
|
187
|
|
|
* @method static void setMemoryReserveSize(int $value) Sets the size of the reserved memory. |
|
188
|
|
|
* @see \yii\base\ErrorHandler::memoryReserveSize |
|
189
|
|
|
* |
|
190
|
|
|
* @method static void setPreviousExceptionView(string $value) Sets the path of the view file for rendering previous exceptions. |
|
191
|
|
|
* @see \yii\web\ErrorHandler::previousExceptionView |
|
192
|
|
|
*/ |
|
193
|
|
|
class Error extends Facade |
|
194
|
|
|
{ |
|
195
|
|
|
/** |
|
196
|
|
|
* @inheritDoc |
|
197
|
|
|
*/ |
|
198
|
1 |
|
public static function getFacadeComponentId() |
|
199
|
|
|
{ |
|
200
|
1 |
|
return 'errorHandler'; |
|
201
|
|
|
} |
|
202
|
|
|
} |
|
203
|
|
|
|