From 3c9e868ce14d159339bcdf32408955dceea8fe9d Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 20 Mar 2026 16:08:58 +0800 Subject: [PATCH] Add spc-debug script on Windows --- bin/spc-debug.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bin/spc-debug.ps1 diff --git a/bin/spc-debug.ps1 b/bin/spc-debug.ps1 new file mode 100644 index 00000000..015dae9c --- /dev/null +++ b/bin/spc-debug.ps1 @@ -0,0 +1,12 @@ +$PHP_Exec = ".\runtime\php.exe" + +if (-not(Test-Path $PHP_Exec)) { + $PHP_Exec = Get-Command php.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Definition + if (-not $PHP_Exec) { + Write-Host "Error: PHP not found, you need to install PHP on your system or use 'bin/setup-runtime'." -ForegroundColor Red + exit 1 + } +} + +& "$PHP_Exec" -d xdebug.mode=debug -d xdebug.client_host=127.0.0.1 -d xdebug.client_port=9003 -d xdebug.start_with_request=yes ("bin/spc") @args +exit $LASTEXITCODE