From 35cb3d34d89ef8d6fe8906eb045007023736f8aa Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 10 Sep 2026 23:43:58 +0300 Subject: [PATCH] Add result summary banner and use PHP_BINARY for preflight --- backend/scripts/promote_grade10_candidate.php | 3 ++- backend/scripts/validate_grade10_candidate.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/scripts/promote_grade10_candidate.php b/backend/scripts/promote_grade10_candidate.php index 861c368..15595a9 100644 --- a/backend/scripts/promote_grade10_candidate.php +++ b/backend/scripts/promote_grade10_candidate.php @@ -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') { diff --git a/backend/scripts/validate_grade10_candidate.php b/backend/scripts/validate_grade10_candidate.php index 1b18238..68412e3 100644 --- a/backend/scripts/validate_grade10_candidate.php +++ b/backend/scripts/validate_grade10_candidate.php @@ -425,6 +425,7 @@ function finish(): never foreach ($warnings as $issue) { echo '[WARN] ' . $issue['code'] . ' — ' . $issue['message'] . PHP_EOL; } + echo PHP_EOL . sprintf("=== INTAKE RESULT: %s (%d errors, %d warnings) ===", strtoupper($result['status']), count($errors), count($warnings)) . PHP_EOL; } exit($errors === [] ? 0 : 1); }