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); }