Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
guanhui07 committed Feb 5, 2023
1 parent 697e44a commit c62ffa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function cException($exception)
$log_data .= date("Y-m-d H:i:s") . ' ' . $exception->__toString();

writeLog($log_data, 'exception_error');
echo 'exception_error';
echo $log_data;
return;
}

Expand Down
6 changes: 5 additions & 1 deletion dcr/Framework/Boostrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace DcrSwoole\Framework;

use App\Exception\RuntimeException;
use App\Provider\EventServiceProvider;
use App\Utils\ConfigBase;
use DcrSwoole\Event\EventInstance;
Expand Down Expand Up @@ -100,7 +101,10 @@ public function bootRedis()
*/
protected function loadDotEnv(): void
{
$dotenv = Dotenv::createImmutable(PROJECT_ROOT);
if (!file_exists(base_path().'.env')) {
throw new RuntimeException('.env 不存在,请根据env.example 创建.env文件');
}
$dotenv = Dotenv::createImmutable(base_path());
$dotenv->safeLoad();
}

Expand Down

0 comments on commit c62ffa1

Please sign in to comment.