From b9972f93538247fc7cd0d521c7b5be6d5de7b20b Mon Sep 17 00:00:00 2001 From: augushong Date: Mon, 5 Sep 2022 17:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8tp=E5=86=85=E7=BD=AE=E7=9A=84?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=A1=8C=E4=BA=A4=E4=BA=92=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/command/Curd.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/common/command/Curd.php b/app/common/command/Curd.php index a130f13..90994ea 100644 --- a/app/common/command/Curd.php +++ b/app/common/command/Curd.php @@ -109,9 +109,10 @@ class Curd extends Command $output->writeln($key); } $output->writeln(">>>>>>>>>>>>>>>"); - $output->writeln("确定强制生成上方所有文件? 如果文件存在会直接覆盖。 请输入 'yes' 按回车键继续操作: "); - $line = fgets(defined('STDIN') ? STDIN : fopen('php://stdin', 'r')); - if (trim($line) != 'yes') { + + $ask_force_delete_result = $output->confirm($input,'确定强制生成上方所有文件? 如果文件存在会直接覆盖。'); + + if (!$ask_force_delete_result) { throw new Exception("取消文件CURD生成操作"); } } @@ -123,9 +124,10 @@ class Curd extends Command $output->writeln($key); } $output->writeln(">>>>>>>>>>>>>>>"); - $output->writeln("确定删除上方所有文件? 请输入 'yes' 按回车键继续操作: "); - $line = fgets(defined('STDIN') ? STDIN : fopen('php://stdin', 'r')); - if (trim($line) != 'yes') { + + $ask_force_delete_result = $output->confirm($input,'确定删除上方所有文件? '); + + if (!$ask_force_delete_result) { throw new Exception("取消删除文件操作"); } $result = $build->delete();