File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ function cException($exception)
62
62
$ log_data .= date ("Y-m-d H:i:s " ) . ' ' . $ exception ->__toString ();
63
63
64
64
writeLog ($ log_data , 'exception_error ' );
65
- echo ' exception_error ' ;
65
+ echo $ log_data ;
66
66
return ;
67
67
}
68
68
Original file line number Diff line number Diff line change 4
4
5
5
namespace DcrSwoole \Framework ;
6
6
7
+ use App \Exception \RuntimeException ;
7
8
use App \Provider \EventServiceProvider ;
8
9
use App \Utils \ConfigBase ;
9
10
use DcrSwoole \Event \EventInstance ;
@@ -100,7 +101,10 @@ public function bootRedis()
100
101
*/
101
102
protected function loadDotEnv (): void
102
103
{
103
- $ dotenv = Dotenv::createImmutable (PROJECT_ROOT );
104
+ if (!file_exists (base_path ().'.env ' )) {
105
+ throw new RuntimeException ('.env 不存在,请根据env.example 创建.env文件 ' );
106
+ }
107
+ $ dotenv = Dotenv::createImmutable (base_path ());
104
108
$ dotenv ->safeLoad ();
105
109
}
106
110
You can’t perform that action at this time.
0 commit comments