Add result summary banner and use PHP_BINARY for preflight
This commit is contained in:
@@ -42,8 +42,9 @@ $manifestPath = $candidateRoot . '/' . basename($manifestName);
|
|||||||
$validator = $projectRoot . '/backend/scripts/validate_grade10_candidate.php';
|
$validator = $projectRoot . '/backend/scripts/validate_grade10_candidate.php';
|
||||||
|
|
||||||
// 1. Mandatory gate preflight: identical strict rules, no exceptions.
|
// 1. Mandatory gate preflight: identical strict rules, no exceptions.
|
||||||
|
$phpBinary = defined('PHP_BINARY') && PHP_BINARY !== '' ? PHP_BINARY : 'php';
|
||||||
$gateJson = shell_exec(
|
$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);
|
$gate = json_decode((string) $gateJson, true);
|
||||||
if (!is_array($gate) || ($gate['status'] ?? null) !== 'passed') {
|
if (!is_array($gate) || ($gate['status'] ?? null) !== 'passed') {
|
||||||
|
|||||||
@@ -425,6 +425,7 @@ function finish(): never
|
|||||||
foreach ($warnings as $issue) {
|
foreach ($warnings as $issue) {
|
||||||
echo '[WARN] ' . $issue['code'] . ' — ' . $issue['message'] . PHP_EOL;
|
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);
|
exit($errors === [] ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user