mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 01:09:21 +02:00
Add $whoopsHandler as variable, can be used by other scripts
This commit is contained in:
parent
da1816cc13
commit
b0c8cf2ecd
@ -9,16 +9,16 @@
|
||||
*/
|
||||
|
||||
use MyAAC\Exceptions\SensitiveException;
|
||||
use Whoops\Handler\PlainTextHandler;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
use Whoops\Run;
|
||||
|
||||
if (class_exists(\Whoops\Run::class)) {
|
||||
$whoops = new \Whoops\Run;
|
||||
if(IS_CLI) {
|
||||
$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
|
||||
}
|
||||
else {
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
|
||||
}
|
||||
if (class_exists(Run::class)) {
|
||||
$whoops = new Run;
|
||||
|
||||
$whoopsHandler = IS_CLI ? (new PlainTextHandler()) : (new PrettyPageHandler());
|
||||
|
||||
$whoops->pushHandler($whoopsHandler);
|
||||
$whoops->register();
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user