From 9f05541fa8051d5815ca7e0b0bcae9b2408cc1d5 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Sun, 1 Mar 2026 23:42:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E8=BF=9B=20PHP=20=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E6=A3=80=E6=9F=A5=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 7 +++---- index.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6601baf..e3db515 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -25,10 +25,9 @@ jobs: echo "📝 PHP 语法检查..." errors=0 for file in $(find . -name "*.php" -not -path "./vendor/*"); do - output=$(php -l "$file" 2>&1) - if [ $? -ne 0 ]; then - echo "错误: $file" - echo "$output" + if ! php -l "$file" > /dev/null 2>&1; then + echo "❌ 语法错误: $file" + php -l "$file" || true errors=$((errors + 1)) fi done diff --git a/index.php b/index.php index f9494d8..effd874 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@