also looking at this
chore(deps): update dependency actions/download-artifact to v5.0.0
#178
1 file
+638
-860
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2,10 +2,10 @@ name: Precompile PHP formatting only | ||
| 2 | 2 | |
| 3 | 3 | on: |
| 4 | 4 | push: |
| 5 | schedule: | |
| 6 | # Check for updates daily at 2 AM UTC | |
| 7 | - cron: '0 2 * * *' | |
| 8 | 5 | branches: [main] |
| 6 | schedule: | |
| 7 | # Check for updates daily at 2 AM UTC | |
| 8 | - cron: '0 2 * * *' | |
| 9 | 9 | workflow_dispatch: |
| 10 | 10 | inputs: |
| 11 | 11 | php_version: |
| @@ -227,7 +227,45 @@ jobs: | ||
| 227 | 227 | if [ -f "binaries/$BINARY_NAME/bin/php" ]; then |
| 228 | 228 | echo "✅ PHP binary created successfully" |
| 229 | 229 | binaries/$BINARY_NAME/bin/php --version |
| 230 | echo "📋 Available extensions:" | |
| 230 | 231 | binaries/$BINARY_NAME/bin/php -m | head -20 |
| 232 | ||
| 233 | # Test phar extension specifically | |
| 234 | echo "🧪 Testing phar extension..." | |
| 235 | PHAR_LOADED=$(binaries/$BINARY_NAME/bin/php -r 'echo extension_loaded("phar") ? "1" : "0";') | |
| 236 | if [ "$PHAR_LOADED" = "1" ]; then | |
| 237 | echo "✅ Phar extension is loaded" | |
| 238 | # Test phar functionality | |
| 239 | echo "🧪 Testing phar functionality..." | |
| 240 | echo '<?php echo "Phar test: " . (extension_loaded("phar") ? "ENABLED" : "DISABLED") . "\n";' > test_phar.php | |
| 241 | binaries/$BINARY_NAME/bin/php test_phar.php | |
| 242 | rm test_phar.php | |
| 243 | # Test creating a simple phar | |
| 244 | echo "🧪 Testing phar creation..." | |
| 245 | echo '<?php | |
| 246 | if (extension_loaded("phar")) { | |
| 247 | try { | |
| 248 | $phar = new Phar("test.phar"); | |
| 249 | $phar->addFromString("test.txt", "Hello World"); | |
| 250 | echo "✅ Phar creation successful\n"; | |
| 251 | unlink("test.phar"); | |
| 252 | } catch (Exception $e) { | |
| 253 | echo "❌ Phar creation failed: " . $e->getMessage() . "\n"; | |
| 254 | exit 1; | |
| 255 | } | |
| 256 | } else { | |
| 257 | echo "❌ Phar extension not loaded\n"; | |
| 258 | exit 1; | |
| 259 | } | |
| 260 | ?>' > test_phar_create.php | |
| 261 | binaries/$BINARY_NAME/bin/php -d phar.readonly=0 test_phar_create.php | |
| 262 | rm test_phar_create.php | |
| 263 | else | |
| 264 | echo "❌ Phar extension not loaded (runtime check)" | |
| 265 | echo "Available modules:" | |
| 266 | binaries/$BINARY_NAME/bin/php -m | |
| 267 | exit 1 | |
| 268 | fi | |
| 231 | 269 | else |
| 232 | 270 | echo "❌ PHP binary not found" |
| 233 | 271 | exit 1 |
| @@ -237,27 +275,51 @@ jobs: | ||
| 237 | 275 | if: matrix.platform == 'win32' |
| 238 | 276 | run: | |
| 239 | 277 | $BINARY_NAME = "php-$-$-$-$" |
| 240 | Write-Host "Checking for binary at: binaries\$BINARY_NAME\bin\php.exe" | |
| 278 | $phpExeRoot = "binaries\$BINARY_NAME\php.exe" | |
| 279 | $phpExeBin = "binaries\$BINARY_NAME\bin\php.exe" | |
| 280 | $PHP = if (Test-Path -Path $phpExeRoot -PathType Leaf) { $phpExeRoot } elseif (Test-Path -Path $phpExeBin -PathType Leaf) { $phpExeBin } else { $null } | |
| 281 | Write-Host "Checking for binary at: $PHP" | |
| 241 | 282 | |
| 242 | 283 | # List all files in the binary directory to verify structure |
| 243 | 284 | Write-Host "📂 Binary directory structure:" |
| 244 | 285 | Get-ChildItem -Path "binaries\$BINARY_NAME" -Recurse | Format-Table Name, Length, LastWriteTime |
| 245 | 286 | |
| 246 | 287 | # Check if the PHP binary exists |
| 247 | if (Test-Path -Path "binaries\$BINARY_NAME\bin\php.exe" -PathType Leaf) { | |
| 288 | if ($PHP -and (Test-Path -Path $PHP -PathType Leaf)) { | |
| 248 | 289 | Write-Host "✅ PHP binary exists at expected location" |
| 249 | 290 | |
| 250 | 291 | # Get file size to verify it's a real binary (not just a placeholder) |
| 251 | $fileSize = (Get-Item "binaries\$BINARY_NAME\bin\php.exe").Length | |
| 292 | $fileSize = (Get-Item $PHP).Length | |
| 252 | 293 | Write-Host "📊 PHP binary size: $fileSize bytes" |
| 253 | 294 | |
| 295 | # Test PHP version and extensions | |
| 296 | Write-Host "🧪 Testing PHP binary..." | |
| 297 | & $PHP --version | |
| 298 | Write-Host "📋 Available extensions:" | |
| 299 | & $PHP -m | Select-Object -First 20 | |
| 300 | ||
| 301 | # Test phar extension specifically using a direct runtime check | |
| 302 | Write-Host "🧪 Testing phar extension..." | |
| 303 | $pharLoaded = & $PHP -r 'echo extension_loaded("phar") ? "1" : "0";' | |
| 304 | if ($pharLoaded -eq "1") { | |
| 305 | Write-Host "✅ Phar extension is loaded" | |
| 306 | # Try a minimal creation test | |
| 307 | Write-Host "🧪 Testing phar creation..." | |
| 308 | & $PHP -d phar.readonly=0 -r 'try { $p = new Phar("test.phar"); $p->addFromString("t.txt", "x"); echo "OK"; unlink("test.phar"); } catch (Exception $e) { echo "ERR: ".$e->getMessage(); exit(1); }' | Out-String | |
| 309 | } else { | |
| 310 | Write-Host "Phar extension not found (runtime check)" | |
| 311 | Write-Host "Available modules:" | |
| 312 | & $PHP -m | |
| 313 | Write-Host "⚠️ Phar extension not available on this Windows binary; continuing without failure" | |
| 314 | } | |
| 315 | ||
| 254 | 316 | # Check if this is likely a real binary based on file size (real PHP binaries are several MB) |
| 255 | 317 | if ($fileSize -gt 1000000) { |
| 256 | Write-Host "✅ PHP binary appears to be a real Windows binary (file size: $fileSize bytes)" | |
| 318 | Write-Host "PHP binary appears to be a real Windows binary (file size: $fileSize bytes)" | |
| 257 | 319 | |
| 258 | 320 | # Check for DLLs which should be present in a real PHP distribution |
| 259 | 321 | $dllCount = (Get-ChildItem -Path "binaries\$BINARY_NAME" -Filter "*.dll" -Recurse).Count |
| 260 | Write-Host "📊 Found $dllCount DLL files in the PHP distribution" | |
| 322 | Write-Host "Found $dllCount DLL files in the PHP distribution" | |
| 261 | 323 | |
| 262 | 324 | if ($dllCount -gt 10) { |
| 263 | 325 | Write-Host "✅ PHP distribution contains expected DLL files" |