feat(Docker): Upgrade to PHP 8.5.0RC3 with native ext-uri support

BREAKING CHANGE: Requires PHP 8.5.0RC3

Changes:
- Update Docker base image from php:8.4-fpm to php:8.5.0RC3-fpm
- Enable ext-uri for native WHATWG URL parsing support
- Update composer.json PHP requirement from ^8.4 to ^8.5
- Add ext-uri as required extension in composer.json
- Move URL classes from Url.php85/ to Url/ directory (now compatible)
- Remove temporary PHP 8.4 compatibility workarounds

Benefits:
- Native URL parsing with Uri\WhatWg\Url class
- Better performance for URL operations
- Future-proof with latest PHP features
- Eliminates PHP version compatibility issues
This commit is contained in:
2025-10-27 09:31:28 +01:00
parent 799f74f00a
commit c8b47e647d
81 changed files with 6988 additions and 601 deletions

View File

@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\Core\ValueObjects\Hash;
use App\Framework\Core\ValueObjects\HashAlgorithm;
use App\Framework\UserAgent\UserAgentParser;
echo "=== Testing Hash Value Object Integration ===\n\n";
// Test 1: Hash VO mit xxh3
echo "Test 1: Hash VO with xxh3 algorithm\n";
echo "-----------------------------------\n";
$data = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0";
$hash = Hash::create($data, HashAlgorithm::XXHASH3);
echo "Data: {$data}\n";
echo "Algorithm: " . $hash->getAlgorithm()->value . "\n";
echo "Hash: " . $hash->toString() . "\n";
echo "Hash Length: " . strlen($hash->toString()) . "\n\n";
// Test 2: HashAlgorithm::fast()
echo "Test 2: HashAlgorithm::fast() method\n";
echo "-----------------------------------\n";
$fastAlgo = HashAlgorithm::fast();
echo "Fast Algorithm: " . $fastAlgo->value . "\n";
echo "Is xxh3 available: " . (HashAlgorithm::XXHASH3->isAvailable() ? 'Yes' : 'No') . "\n";
echo "Is xxh64 available: " . (HashAlgorithm::XXHASH64->isAvailable() ? 'Yes' : 'No') . "\n\n";
// Test 3: UserAgentParser mit Hash VO
echo "Test 3: UserAgentParser using Hash VO\n";
echo "-----------------------------------\n";
$parser = new UserAgentParser();
$ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/120.0.0.0";
$parsed = $parser->parse($ua);
echo "User-Agent: {$ua}\n";
echo "Browser: " . $parsed->browser->getDisplayName() . "\n";
echo "Browser Version: " . $parsed->browserVersion->toString() . "\n";
echo "Platform: " . $parsed->platform->getDisplayName() . "\n";
echo "Platform Version: " . $parsed->platformVersion->toString() . "\n";
echo "Engine: " . $parsed->engine->getDisplayName() . "\n";
echo "Is Modern: " . ($parsed->isModern ? 'Yes' : 'No') . "\n\n";
// Test 4: Hash comparison
echo "Test 4: Hash equality check\n";
echo "-----------------------------------\n";
$hash1 = Hash::create("test data", HashAlgorithm::XXHASH3);
$hash2 = Hash::create("test data", HashAlgorithm::XXHASH3);
$hash3 = Hash::create("different data", HashAlgorithm::XXHASH3);
echo "Hash1 equals Hash2: " . ($hash1->equals($hash2) ? 'Yes' : 'No') . "\n";
echo "Hash1 equals Hash3: " . ($hash1->equals($hash3) ? 'Yes' : 'No') . "\n\n";
// Test 5: Available hash algorithms
echo "Test 5: Available hash algorithms\n";
echo "-----------------------------------\n";
foreach (HashAlgorithm::cases() as $algo) {
$available = $algo->isAvailable() ? '✓' : '✗';
$secure = $algo->isSecure() ? '(secure)' : '(fast)';
echo "{$available} {$algo->value} - Length: {$algo->getLength()} chars {$secure}\n";
}
echo "\n=== All Tests Completed Successfully ===\n";