feat: 优化curd临时文件生成时输出内容效果,方便编辑器定位文件;

This commit is contained in:
augushong
2025-03-25 09:41:55 +08:00
parent 4adcc39eda
commit cfe5b58d36
2 changed files with 5 additions and 3 deletions

View File

@@ -55,8 +55,7 @@ class CurdBase extends Command
->setForce($force); ->setForce($force);
if ($input->hasOption('runtime')) { if ($input->hasOption('runtime')) {
$runtime_path = App::getRuntimePath() . 'source/build/' . date('YmdHis') . '/'; $runtime_path = App::getRuntimePath() . 'source' . DS . 'build' . DS . date('YmdHis') . DS;
dump($runtime_path);
PathTools::intiDir($runtime_path . 'a.temp'); PathTools::intiDir($runtime_path . 'a.temp');
$build->setRootDir($runtime_path); $build->setRootDir($runtime_path);
@@ -135,7 +134,7 @@ class CurdBase extends Command
if ($input->hasOption('runtime')) { if ($input->hasOption('runtime')) {
$base_path = str_replace($runtime_path, '', $vo); $base_path = str_replace($runtime_path, '', $vo);
$root_path = App::getRootPath(); $root_path = App::getRootPath();
$output_endfix = ' >> ' . $root_path . $base_path; $output_endfix = PHP_EOL . 'ORIGIN:>>' . str_repeat(' ', 26) . ' ' . $root_path . $base_path . ' ';
} }
$output->info($vo . $output_endfix . ' '); $output->info($vo . $output_endfix . ' ');
} }

3
think
View File

@@ -6,6 +6,9 @@ namespace think;
// 加载基础文件 // 加载基础文件
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
// 声明全局变量
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_PATH', __DIR__ . DS);
define('REUQEST_UID', uniqid()); define('REUQEST_UID', uniqid());
// 应用初始化 // 应用初始化