style(runtime): 统一入口脚本与迁移文件格式

This commit is contained in:
Anyon 2026-04-02 13:20:53 +08:00
parent 46c92cee8b
commit 36362fab08
5 changed files with 57 additions and 50 deletions

View File

@ -17,7 +17,6 @@ declare(strict_types=1);
* | github 代码仓库https://github.com/zoujingli/ThinkAdmin * | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* +---------------------------------------------------------------------- * +----------------------------------------------------------------------
*/ */
use app\admin\Service; use app\admin\Service;
use think\admin\extend\PhinxExtend; use think\admin\extend\PhinxExtend;
use think\admin\model\SystemConfig; use think\admin\model\SystemConfig;

View File

@ -55,7 +55,7 @@ class DbIndexStruct extends Command
$number = 1; $number = 1;
$renamed = 0; $renamed = 0;
foreach ($tables as $table) { foreach ($tables as $table) {
$this->output->writeln(sprintf("[%s/%s] 开始处理表 %s", $number++, $total, $table)); $this->output->writeln(sprintf('[%s/%s] 开始处理表 %s', $number++, $total, $table));
$indexes = []; $indexes = [];
foreach (Db::query(sprintf('SHOW INDEX FROM `%s`', $table)) as $index) { foreach (Db::query(sprintf('SHOW INDEX FROM `%s`', $table)) as $index) {
$keyName = strval($index['Key_name'] ?? ''); $keyName = strval($index['Key_name'] ?? '');

View File

@ -1,23 +1,26 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdmin
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | 官方网站: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | 开源协议 ( https://mit-license.org )
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | 免责声明 ( https://thinkadmin.top/disclaimer )
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | 会员特权 ( https://thinkadmin.top/vip-introduce )
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
use think\admin\service\RuntimeService; use think\admin\service\RuntimeService;
// 加载基础文件 // 加载基础文件
require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/../vendor/autoload.php';
// WEB应用初始化 // WEB应用初始化
RuntimeService::doWebsiteInit(); RuntimeService::doWebsiteInit();

View File

@ -1,22 +1,24 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdmin
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | 官方网站: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | 开源协议 ( https://mit-license.org )
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | 免责声明 ( https://thinkadmin.top/disclaimer )
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | 会员特权 ( https://thinkadmin.top/vip-introduce )
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'])) { if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'])) {
return false; return false;
} else { }
$_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/index.php'; $_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/index.php';
require $_SERVER['SCRIPT_FILENAME']; require $_SERVER['SCRIPT_FILENAME'];
}

33
think
View File

@ -1,24 +1,27 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdmin
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | 官方网站: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | 开源协议 ( https://mit-license.org )
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | 免责声明 ( https://thinkadmin.top/disclaimer )
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | 会员特权 ( https://thinkadmin.top/vip-introduce )
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
use think\admin\service\RuntimeService; use think\admin\service\RuntimeService;
// 加载基础文件 // 加载基础文件
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
// 命令行应用初始化 // 命令行应用初始化
RuntimeService::doConsoleInit(); RuntimeService::doConsoleInit();