refactor: 使用官方support\Db和support\Model
- 创建 support/Db.php 和 support/Model.php - 在 bootstrap.php 中自动初始化数据库 - 移除 app/util/Db.php - 更新所有模型和控制器使用官方类 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
use support\Db;
|
||||
use support\Log;
|
||||
use Webman\Bootstrap;
|
||||
use Webman\Config;
|
||||
@@ -73,6 +74,13 @@ foreach (config('plugin', []) as $firm => $projects) {
|
||||
}
|
||||
}
|
||||
|
||||
// 加载数据库类
|
||||
include_once __DIR__ . '/Db.php';
|
||||
include_once __DIR__ . '/Model.php';
|
||||
|
||||
// 初始化数据库
|
||||
Db::init();
|
||||
|
||||
Middleware::load(config('middleware', []));
|
||||
foreach (config('plugin', []) as $firm => $projects) {
|
||||
foreach ($projects as $name => $project) {
|
||||
|
||||
Reference in New Issue
Block a user