修复安装安装时报错

This commit is contained in:
2026-03-21 17:44:52 +08:00
parent e7dfb238e3
commit dc51b63e5e
2 changed files with 19 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<?php
/**
* Phinx 数据库迁移配置
* 从 config/thinkorm.php 读取数据库连接,用于 php vendor/bin/phinx migrate
* 与 Webman ThinkOrm 引导一致Config 加载后合并 thinkorm + think-ormphinx migrate 使用
*/
declare(strict_types=1);
@@ -36,7 +36,18 @@ if (!function_exists('env')) {
}
}
$thinkorm = require $baseDir . '/config/thinkorm.php';
if (!defined('BASE_PATH')) {
define('BASE_PATH', $baseDir);
}
require $baseDir . '/vendor/workerman/webman-framework/src/support/helpers.php';
require $baseDir . '/app/functions.php';
use Webman\Config;
Config::clear();
Config::load($baseDir . '/config', ['route', 'middleware', 'process', 'server', 'static']);
$thinkorm = array_replace_recursive(config('thinkorm', []), config('think-orm', []));
$conn = $thinkorm['connections'][$thinkorm['default'] ?? 'mysql'] ?? [];
$prefix = $conn['prefix'] ?? '';