From dbebb5501bb788b9cee5962929043dfe7f94e0c5 Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 26 Nov 2022 16:28:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=88=A0=E9=99=A4=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=92=8C=E7=94=9F=E6=88=90=E7=89=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/command/build/Dist.php | 8 +++++++- config/dist.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/common/command/build/Dist.php b/app/common/command/build/Dist.php index ec8c60a..0887add 100644 --- a/app/common/command/build/Dist.php +++ b/app/common/command/build/Dist.php @@ -57,6 +57,7 @@ use PhpParser\Node\Expr\Instanceof_; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Identifier; use PhpParser\Node\Param; +use PhpParser\Node\Stmt\Nop; class Dist extends Command { @@ -377,9 +378,14 @@ class Dist extends Command $copyright = Config::get('dist.copyright', []); foreach ($copyright as $text) { - array_unshift($file_stmts, new Comment($text)); + $copyright_stmts[] = new Comment('// '.$text); } + $copyright_stmts_item = new Nop(); + + $copyright_stmts_item->setAttribute('comments', $copyright_stmts); + + array_unshift($file_stmts, $copyright_stmts_item); // 生成代码 $result_content = $pretty_printer->prettyPrintFile($file_stmts); diff --git a/config/dist.php b/config/dist.php index 12cee8a..2fde76e 100644 --- a/config/dist.php +++ b/config/dist.php @@ -79,8 +79,8 @@ return [ '官网地址: http://ulthon.com', '后台官网地址: http://admin.demo.ulthon.com', '这不是一个自由软件!也不是一个源码文件!', - '不允许对程序代码以任何形式任何目的的再发布', '您正在浏览这段文字说明您正在试图获取或修改代码', + '不允许对程序代码以任何形式任何目的的再发布', '任何对当前文件的浏览、修改、反编译都是非法的,没有获取授权的', ]