- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
89 lines
2.8 KiB
PHP
89 lines
2.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\QrCode\QrCodeGenerator;
|
|
use App\Framework\QrCode\QrCodeRenderer;
|
|
use App\Framework\QrCode\ValueObjects\ErrorCorrectionLevel;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeConfig;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeVersion;
|
|
use App\Framework\QrCode\ValueObjects\EncodingMode;
|
|
use App\Framework\QrCode\ErrorCorrection\ReedSolomonEncoder;
|
|
|
|
echo "=== QR Code Full Pipeline Test ===\n\n";
|
|
|
|
$data = "HELLO";
|
|
echo "Input data: '{$data}'\n";
|
|
echo "Data length: " . strlen($data) . " bytes\n\n";
|
|
|
|
// Create config
|
|
$config = new QrCodeConfig(
|
|
version: QrCodeVersion::fromNumber(1),
|
|
errorCorrectionLevel: ErrorCorrectionLevel::M,
|
|
encodingMode: EncodingMode::BYTE
|
|
);
|
|
|
|
echo "Configuration:\n";
|
|
echo " Version: {$config->version->getVersionNumber()}\n";
|
|
echo " Error Level: {$config->errorCorrectionLevel->value}\n";
|
|
echo " Encoding: {$config->encodingMode->value}\n";
|
|
echo " Matrix Size: {$config->version->getMatrixSize()}x{$config->version->getMatrixSize()}\n\n";
|
|
|
|
// Get EC info
|
|
$ecInfo = ReedSolomonEncoder::getECInfo(
|
|
$config->version->getVersionNumber(),
|
|
$config->errorCorrectionLevel->value
|
|
);
|
|
|
|
echo "Error Correction Info:\n";
|
|
echo " Total codewords: {$ecInfo['totalCodewords']}\n";
|
|
echo " Data codewords: {$ecInfo['dataCodewords']}\n";
|
|
echo " EC codewords: {$ecInfo['ecCodewords']}\n";
|
|
echo " Blocks: {$ecInfo['blocks']}\n";
|
|
echo " EC per block: {$ecInfo['ecPerBlock']}\n\n";
|
|
|
|
// Generate QR Code
|
|
echo "Generating QR Code...\n";
|
|
$matrix = QrCodeGenerator::generate($data, $config);
|
|
|
|
echo "Matrix generated successfully!\n";
|
|
echo " Size: {$matrix->getSize()}x{$matrix->getSize()}\n";
|
|
echo " Version: {$matrix->getVersion()->getVersionNumber()}\n\n";
|
|
|
|
// Count modules
|
|
$darkCount = 0;
|
|
$lightCount = 0;
|
|
$size = $matrix->getSize();
|
|
|
|
for ($row = 0; $row < $size; $row++) {
|
|
for ($col = 0; $col < $size; $col++) {
|
|
$module = $matrix->getModuleAt($row, $col);
|
|
if ($module->isDark()) {
|
|
$darkCount++;
|
|
} else {
|
|
$lightCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
echo "Module Statistics:\n";
|
|
echo " Total modules: " . ($darkCount + $lightCount) . "\n";
|
|
echo " Dark modules: {$darkCount}\n";
|
|
echo " Light modules: {$lightCount}\n";
|
|
echo " Dark ratio: " . round(($darkCount / ($darkCount + $lightCount)) * 100, 2) . "%\n\n";
|
|
|
|
// Generate SVG
|
|
echo "Rendering SVG...\n";
|
|
$renderer = new QrCodeRenderer();
|
|
$svg = $renderer->renderSvg($matrix);
|
|
|
|
$outputPath = __DIR__ . '/../../public/qrcode-full-test.svg';
|
|
file_put_contents($outputPath, $svg);
|
|
|
|
echo "✅ SVG saved to: public/qrcode-full-test.svg\n";
|
|
echo "✅ QR Code generated with full Reed-Solomon error correction\n\n";
|
|
|
|
echo "Test the QR code by scanning: https://localhost/qrcode-full-test.svg\n";
|