Skip to content

Commit 13da29f

Browse files
committed
chore: wip
1 parent 8329dce commit 13da29f

39 files changed

+786
-565
lines changed

.github/workflows/precompile-php.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ on:
99
workflow_dispatch:
1010
inputs:
1111
php_version:
12-
description: 'PHP version to build (leave empty for auto-detection)'
12+
description: PHP version to build (leave empty for auto-detection)
1313
required: false
1414
type: string
1515
php_config:
16-
description: 'PHP build configuration'
16+
description: PHP build configuration
1717
required: true
18-
default: 'laravel-mysql'
18+
default: laravel-mysql
1919
type: choice
2020
options:
2121
- laravel-mysql
@@ -26,7 +26,7 @@ on:
2626
- wordpress
2727
- full-stack
2828
force_rebuild:
29-
description: 'Force rebuild even if no updates'
29+
description: Force rebuild even if no updates
3030
required: false
3131
default: false
3232
type: boolean
@@ -243,7 +243,7 @@ jobs:
243243
binaries/$BINARY_NAME/bin/php --version
244244
echo "📋 All available extensions:"
245245
binaries/$BINARY_NAME/bin/php -m
246-
246+
247247
# Define essential extensions that MUST be present
248248
REQUIRED_EXTENSIONS=(
249249
"Core" "date" "hash" "json" "pcre" "Reflection" "SPL" "standard"
@@ -252,10 +252,10 @@ jobs:
252252
"curl" "openssl" "zip" "zlib" "calendar" "ftp" "pcntl" "posix"
253253
"shmop" "sockets" "exif" "bcmath" "bz2" "gettext" "readline"
254254
)
255-
255+
256256
# Define Zend extensions that need special checking
257257
ZEND_EXTENSIONS=("opcache")
258-
258+
259259
# Test each required extension
260260
echo "🧪 Testing essential extensions..."
261261
MISSING_EXTENSIONS=()
@@ -268,7 +268,7 @@ jobs:
268268
MISSING_EXTENSIONS+=("$ext")
269269
fi
270270
done
271-
271+
272272
# Test Zend extensions separately
273273
for ext in "${ZEND_EXTENSIONS[@]}"; do
274274
EXT_LOADED=$(binaries/$BINARY_NAME/bin/php -r "echo function_exists('opcache_get_status') ? '1' : '0';")
@@ -279,22 +279,22 @@ jobs:
279279
MISSING_EXTENSIONS+=("$ext")
280280
fi
281281
done
282-
282+
283283
# Check if any essential extensions are missing
284284
if [ ${#MISSING_EXTENSIONS[@]} -gt 0 ]; then
285285
echo "❌ Critical extensions missing: ${MISSING_EXTENSIONS[*]}"
286286
echo "This build is incomplete and will cause issues with Composer and Laravel."
287287
exit 1
288288
fi
289-
289+
290290
# Test phar extension functionality specifically
291291
echo "🧪 Testing phar extension functionality..."
292292
PHAR_LOADED=$(binaries/$BINARY_NAME/bin/php -r 'echo extension_loaded("phar") ? "1" : "0";')
293293
if [ "$PHAR_LOADED" = "1" ]; then
294294
echo "✅ Phar extension is loaded"
295295
# Test phar creation (essential for Composer)
296296
echo "🧪 Testing phar creation..."
297-
echo '<?php
297+
echo '<?php
298298
if (extension_loaded("phar")) {
299299
try {
300300
$phar = new Phar("test.phar");
@@ -316,7 +316,7 @@ jobs:
316316
echo "❌ Phar extension not loaded - this will break Composer!"
317317
exit 1
318318
fi
319-
319+
320320
# Test Composer compatibility
321321
echo "🧪 Testing Composer compatibility..."
322322
echo '<?php
@@ -325,7 +325,7 @@ jobs:
325325
"iconv", "mb_strlen", "filter_var", "hash", "json_encode",
326326
"curl_init", "openssl_get_cert_locations", "file_get_contents"
327327
];
328-
328+
329329
foreach ($required_functions as $func) {
330330
if (function_exists($func)) {
331331
echo "✅ Function $func: Available\n";
@@ -334,7 +334,7 @@ jobs:
334334
exit(1);
335335
}
336336
}
337-
337+
338338
// Test essential classes
339339
$required_classes = ["Phar", "DOMDocument", "XMLReader", "ZipArchive"];
340340
foreach ($required_classes as $class) {
@@ -345,12 +345,12 @@ jobs:
345345
exit(1);
346346
}
347347
}
348-
348+
349349
echo "✅ All Composer compatibility checks passed\n";
350350
?>' > test_composer_compat.php
351351
binaries/$BINARY_NAME/bin/php test_composer_compat.php
352352
rm test_composer_compat.php
353-
353+
354354
echo "✅ All PHP binary tests passed successfully!"
355355
else
356356
echo "❌ PHP binary not found"
@@ -365,25 +365,25 @@ jobs:
365365
$phpExeBin = "binaries\$BINARY_NAME\bin\php.exe"
366366
$PHP = if (Test-Path -Path $phpExeRoot -PathType Leaf) { $phpExeRoot } elseif (Test-Path -Path $phpExeBin -PathType Leaf) { $phpExeBin } else { $null }
367367
Write-Host "Checking for binary at: $PHP"
368-
368+
369369
# List all files in the binary directory to verify structure
370370
Write-Host "📂 Binary directory structure:"
371371
Get-ChildItem -Path "binaries\$BINARY_NAME" -Recurse | Format-Table Name, Length, LastWriteTime
372-
372+
373373
# Check if the PHP binary exists
374374
if ($PHP -and (Test-Path -Path $PHP -PathType Leaf)) {
375375
Write-Host "✅ PHP binary exists at expected location"
376-
376+
377377
# Get file size to verify it's a real binary (not just a placeholder)
378378
$fileSize = (Get-Item $PHP).Length
379379
Write-Host "📊 PHP binary size: $fileSize bytes"
380-
380+
381381
# Test PHP version and extensions
382382
Write-Host "🧪 Testing PHP binary..."
383383
& $PHP --version
384384
Write-Host "📋 All available extensions:"
385385
& $PHP -m
386-
386+
387387
# Define essential extensions that MUST be present
388388
$REQUIRED_EXTENSIONS = @(
389389
"Core", "date", "hash", "json", "pcre", "Reflection", "SPL", "standard",
@@ -392,10 +392,10 @@ jobs:
392392
"curl", "openssl", "zip", "zlib", "calendar", "ftp",
393393
"shmop", "sockets", "exif", "bcmath", "bz2", "gettext", "readline"
394394
)
395-
395+
396396
# Define Zend extensions that need special checking
397397
$ZEND_EXTENSIONS = @("opcache")
398-
398+
399399
# Test each required extension
400400
Write-Host "🧪 Testing essential extensions..."
401401
$MISSING_EXTENSIONS = @()
@@ -408,7 +408,7 @@ jobs:
408408
$MISSING_EXTENSIONS += $ext
409409
}
410410
}
411-
411+
412412
# Test Zend extensions separately
413413
foreach ($ext in $ZEND_EXTENSIONS) {
414414
$extLoaded = & $PHP -r "echo function_exists('opcache_get_status') ? '1' : '0';"
@@ -419,14 +419,14 @@ jobs:
419419
$MISSING_EXTENSIONS += $ext
420420
}
421421
}
422-
422+
423423
# Check if any essential extensions are missing
424424
if ($MISSING_EXTENSIONS.Count -gt 0) {
425425
Write-Host "❌ Critical extensions missing: $($MISSING_EXTENSIONS -join ', ')"
426426
Write-Host "This build is incomplete and will cause issues with Composer and Laravel."
427427
exit 1
428428
}
429-
429+
430430
# Test phar extension functionality specifically
431431
Write-Host "🧪 Testing phar extension functionality..."
432432
$pharLoaded = & $PHP -r 'echo extension_loaded("phar") ? "1" : "0";'
@@ -445,22 +445,22 @@ jobs:
445445
Write-Host "❌ Phar extension not loaded - this will break Composer!"
446446
exit 1
447447
}
448-
448+
449449
# Test Composer compatibility
450450
Write-Host "🧪 Testing Composer compatibility..."
451451
$composerTestContent = "<?php`n// Test essential functions for Composer`n`$required_functions = [`n `"iconv`", `"mb_strlen`", `"filter_var`", `"hash`", `"json_encode`",`n `"curl_init`", `"openssl_get_cert_locations`", `"file_get_contents`"`n];`n`nforeach (`$required_functions as `$func) {`n if (function_exists(`$func)) {`n echo `"✅ Function `$func: Available\n`";`n } else {`n echo `"❌ Function `$func: Missing\n`";`n exit(1);`n }`n}`n`n// Test essential classes`n`$required_classes = [`"Phar`", `"DOMDocument`", `"XMLReader`", `"ZipArchive`"];`nforeach (`$required_classes as `$class) {`n if (class_exists(`$class)) {`n echo `"✅ Class `$class: Available\n`";`n } else {`n echo `"❌ Class `$class: Missing\n`";`n exit(1);`n }`n}`n`necho `"✅ All Composer compatibility checks passed\n`";`n?>"
452452
$composerTestContent | Out-File -FilePath "test_composer_compat.php" -Encoding UTF8
453453
& $PHP "test_composer_compat.php"
454454
Remove-Item "test_composer_compat.php"
455-
455+
456456
# Check if this is likely a real binary based on file size
457457
if ($fileSize -gt 1000000) {
458458
Write-Host "✅ PHP binary appears to be a real Windows binary (file size: $fileSize bytes)"
459-
459+
460460
# Check for DLLs which should be present in a real PHP distribution
461461
$dllCount = (Get-ChildItem -Path "binaries\$BINARY_NAME" -Filter "*.dll" -Recurse).Count
462462
Write-Host "Found $dllCount DLL files in the PHP distribution"
463-
463+
464464
if ($dllCount -gt 10) {
465465
Write-Host "✅ PHP distribution contains expected DLL files"
466466
} else {
@@ -469,7 +469,7 @@ jobs:
469469
} else {
470470
Write-Host "⚠️ PHP binary is smaller than expected, might be a placeholder"
471471
}
472-
472+
473473
Write-Host "✅ All PHP binary tests passed successfully!"
474474
} else {
475475
Write-Host "❌ PHP binary not found at expected location"
@@ -603,7 +603,7 @@ jobs:
603603
jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json
604604
mv temp_array.json binaries_array.json
605605
done
606-
606+
607607
# Process zip files (Windows binaries)
608608
echo "Processing Windows binaries (.zip files)..."
609609
for zipfile in $(find . -name "*.zip" -type f); do
@@ -635,10 +635,10 @@ jobs:
635635
# Create a temporary directory
636636
temp_dir="temp_extract_$RANDOM"
637637
mkdir -p "$temp_dir"
638-
638+
639639
# Try to extract just the metadata file
640640
unzip -q -j "$zipfile" "*/metadata.json" -d "$temp_dir" 2>/dev/null || echo '{}' > "$temp_dir/metadata.json"
641-
641+
642642
# Create JSON object for this binary
643643
binary_json=$(jq -n \
644644
--arg filename "$filename" \
@@ -663,7 +663,7 @@ jobs:
663663
# Add this binary to the array using jq
664664
jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json
665665
mv temp_array.json binaries_array.json
666-
666+
667667
# Clean up temp directory
668668
rm -rf "$temp_dir"
669669
done

packages/launchpad/bin/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ cli
941941
.example('launchpad reinstall php --force')
942942
.example('launchpad reinstall node --global')
943943
.example('launchpad reinstall --dry-run')
944-
.action(async (packages: string[], options?: {
944+
.action(async (packages: string[], options?: {
945945
verbose?: boolean
946946
force?: boolean
947947
dryRun?: boolean

0 commit comments

Comments
 (0)