Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
26 | private function initEnv(){ |
||
27 | $dotEnv = new Dotenv($this->basePath); |
||
28 | $dotEnv->load(); |
||
29 | date_default_timezone_set(env('APP_TIMEZONE', 'Asia/Shanghai')); |
||
30 | define('IS_CLI', php_sapi_name() == 'cli'); |
||
31 | if (env('DEBUG',false)) { |
||
32 | error_reporting(E_ALL); |
||
33 | @ini_set('display_errors', 'On'); |
||
|
|||
34 | //@ob_start(); |
||
35 | $whoops=new Run; |
||
36 | $handle=IS_CLI ? "PlainTextHandler" : "PrettyPageHandler"; |
||
37 | $handle="\\Whoops\\Handler\\".$handle; |
||
38 | $whoops->pushHandler(new $handle); |
||
39 | $whoops->register(); |
||
40 | } |
||
41 | |||
42 | } |
||
43 | /** |
||
52 | } |
If you suppress an error, we recommend checking for the error condition explicitly: