修复安装安装时报错
This commit is contained in:
15
phinx.php
15
phinx.php
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Phinx 数据库迁移配置
|
||||
* 从 config/thinkorm.php 读取数据库连接,用于 php vendor/bin/phinx migrate
|
||||
* 与 Webman ThinkOrm 引导一致:Config 加载后合并 thinkorm + think-orm,供 phinx 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'] ?? '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user