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', '这不是一个自由软件!也不是一个源码文件!', - '不允许对程序代码以任何形式任何目的的再发布', '您正在浏览这段文字说明您正在试图获取或修改代码', + '不允许对程序代码以任何形式任何目的的再发布', '任何对当前文件的浏览、修改、反编译都是非法的,没有获取授权的', ]