Add result summary banner and use PHP_BINARY for preflight

This commit is contained in:
Hamza-Ayed
2026-09-10 23:43:58 +03:00
parent c280cfc004
commit 35cb3d34d8
2 changed files with 3 additions and 1 deletions
@@ -42,8 +42,9 @@ $manifestPath = $candidateRoot . '/' . basename($manifestName);
$validator = $projectRoot . '/backend/scripts/validate_grade10_candidate.php';
// 1. Mandatory gate preflight: identical strict rules, no exceptions.
$phpBinary = defined('PHP_BINARY') && PHP_BINARY !== '' ? PHP_BINARY : 'php';
$gateJson = shell_exec(
'php ' . escapeshellarg($validator) . ' --json --manifest=' . escapeshellarg(basename($manifestName)) . ' 2>/dev/null'
escapeshellcmd($phpBinary) . ' ' . escapeshellarg($validator) . ' --json --manifest=' . escapeshellarg(basename($manifestName)) . ' 2>/dev/null'
);
$gate = json_decode((string) $gateJson, true);
if (!is_array($gate) || ($gate['status'] ?? null) !== 'passed') {