Skip to content

Commit c62ffa1

Browse files
committed
fixed
1 parent 697e44a commit c62ffa1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function cException($exception)
6262
$log_data .= date("Y-m-d H:i:s") . ' ' . $exception->__toString();
6363

6464
writeLog($log_data, 'exception_error');
65-
echo 'exception_error';
65+
echo $log_data;
6666
return;
6767
}
6868

dcr/Framework/Boostrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace DcrSwoole\Framework;
66

7+
use App\Exception\RuntimeException;
78
use App\Provider\EventServiceProvider;
89
use App\Utils\ConfigBase;
910
use DcrSwoole\Event\EventInstance;
@@ -100,7 +101,10 @@ public function bootRedis()
100101
*/
101102
protected function loadDotEnv(): void
102103
{
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());
104108
$dotenv->safeLoad();
105109
}
106110

0 commit comments

Comments
 (0)