|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace sergeymakinen\facades; |
|
4
|
|
|
|
|
5
|
|
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */ |
|
6
|
|
|
/** |
|
7
|
|
|
* Error facade. |
|
8
|
|
|
* |
|
9
|
|
|
* @method static string addTypeLinks(string $code) Adds informational links to the given PHP type/class. |
|
10
|
|
|
* @method static string argumentsToString(array $args) Converts arguments array to its string representation. |
|
11
|
|
|
* @method static clearOutput() Removes all output echoed before calling this method. |
|
12
|
|
|
* @method static convertExceptionToError(\Exception $exception) Converts an exception into a PHP error. |
|
13
|
|
|
* @method static string convertExceptionToString(\Exception $exception) Converts an exception into a simple string. |
|
14
|
|
|
* @method static string createFrameworkVersionLink() Creates string containing HTML link which refers to the page with the current version. |
|
15
|
|
|
* @method static string createHttpStatusLink(integer $statusCode, string $statusDescription) Creates HTML containing link to the page with the information on given HTTP status code. |
|
16
|
|
|
* @method static string createServerInformationLink() Creates string containing HTML link which refers to the home page of determined web-server software. |
|
17
|
|
|
* @method static string getExceptionName($exception) Returns human-readable exception name. |
|
18
|
|
|
* @method static string getCallStackItemView() Returns $callStackItemView - the path of the view file for rendering exceptions and errors call stack element. |
|
19
|
|
|
* @method static boolean getDiscardExistingOutput() Returns $discardExistingOutput - whether to discard any existing page output before error display. |
|
20
|
|
|
* @method static array getDisplayVars() Returns $displayVars - list of the PHP predefined variables that should be displayed on the error page. |
|
21
|
|
|
* @method static string getErrorAction() Returns $errorAction - the route (e.g. 'site/error') to the controller action that will be used to display external errors. |
|
22
|
|
|
* @method static string getErrorView() Returns $errorView - the path of the view file for rendering exceptions without call stack information. |
|
23
|
|
|
* @method static \Exception getException() Returns $exception - the exception that is being handled currently. |
|
24
|
|
|
* @method static string getExceptionView() Returns $exceptionView - the path of the view file for rendering exceptions. |
|
25
|
|
|
* @method static integer getMaxSourceLines() Returns $maxSourceLines - maximum number of source code lines to be displayed. |
|
26
|
|
|
* @method static integer getMaxTraceSourceLines() Returns $maxTraceSourceLines - maximum number of trace source code lines to be displayed. |
|
27
|
|
|
* @method static integer getMemoryReserveSize() Returns $memoryReserveSize - the size of the reserved memory. |
|
28
|
|
|
* @method static string getPreviousExceptionView() Returns $previousExceptionView - the path of the view file for rendering previous exceptions. |
|
29
|
|
|
* @method static boolean handleError(integer $code, string $message, string $file, integer $line) Handles PHP execution errors such as warnings and notices. |
|
30
|
|
|
* @method static handleException(\Exception $exception) Handles uncaught PHP exceptions. |
|
31
|
|
|
* @method static handleFatalError() Handles fatal PHP errors. |
|
32
|
|
|
* @method static boolean handleHhvmError(integer $code, string $message, string $file, integer $line, $context, mixed $backtrace) Handles HHVM execution errors such as warnings and notices. |
|
33
|
|
|
* @method static string htmlEncode(string $text) Converts special characters to HTML entities. |
|
34
|
|
|
* @method static boolean isCoreFile(string $file) Determines whether given name of the file belongs to the framework. |
|
35
|
|
|
* @method static logException(\Exception $exception) Logs the given exception. |
|
36
|
|
|
* @method static register() Register this error handler. |
|
37
|
|
|
* @method static string renderCallStackItem(string|null $file, integer|null $line, string|null $class, string|null $method, array $args, integer $index) Renders a single call stack element. |
|
38
|
|
|
* @method static string renderFile(string $_file_, array $_params_) Renders a view file as a PHP script. |
|
39
|
|
|
* @method static string renderPreviousExceptions(\Exception $exception) Renders the previous exception stack for a given Exception. |
|
40
|
|
|
* @method static string renderRequest() Renders the global variables of the request. |
|
41
|
|
|
* @method static setCallStackItemView(string $value) Sets $callStackItemView - the path of the view file for rendering exceptions and errors call stack element. |
|
42
|
|
|
* @method static setDiscardExistingOutput(boolean $value) Sets $discardExistingOutput - whether to discard any existing page output before error display. |
|
43
|
|
|
* @method static setDisplayVars(array $value) Sets $displayVars - list of the PHP predefined variables that should be displayed on the error page. |
|
44
|
|
|
* @method static setErrorAction(string $value) Sets $errorAction - the route (e.g. 'site/error') to the controller action that will be used to display external errors. |
|
45
|
|
|
* @method static setErrorView(string $value) Sets $errorView - the path of the view file for rendering exceptions without call stack information. |
|
46
|
|
|
* @method static setException(\Exception $value) Sets $exception - the exception that is being handled currently. |
|
47
|
|
|
* @method static setExceptionView(string $value) Sets $exceptionView - the path of the view file for rendering exceptions. |
|
48
|
|
|
* @method static setMaxSourceLines(integer $value) Sets $maxSourceLines - maximum number of source code lines to be displayed. |
|
49
|
|
|
* @method static setMaxTraceSourceLines(integer $value) Sets $maxTraceSourceLines - maximum number of trace source code lines to be displayed. |
|
50
|
|
|
* @method static setMemoryReserveSize(integer $value) Sets $memoryReserveSize - the size of the reserved memory. |
|
51
|
|
|
* @method static setPreviousExceptionView(string $value) Sets $previousExceptionView - the path of the view file for rendering previous exceptions. |
|
52
|
|
|
* @method static unregister() Unregisters this error handler by restoring the PHP error and exception handlers. |
|
53
|
|
|
*/ |
|
54
|
|
|
class Error extends Facade |
|
55
|
|
|
{ |
|
56
|
|
|
/** |
|
57
|
|
|
* @inheritdoc |
|
58
|
|
|
*/ |
|
59
|
|
|
public static function getFacadeComponentId() |
|
60
|
|
|
{ |
|
61
|
|
|
return 'errorHandler'; |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|