15 lines
480 B
PHP
15 lines
480 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$f = "/var/www/html/api/ambre-early-doc-gen.php";
|
|
$out = ["size"=>@filesize($f)];
|
|
$lint = @shell_exec("php8.4 -l $f 2>&1");
|
|
$out["lint"] = trim($lint);
|
|
// Try to eval the file with mock $_mam set
|
|
$_mam = "Genere un PDF sur: test";
|
|
ob_start();
|
|
$rr = @include $f;
|
|
$out["include_ok"] = $rr !== false;
|
|
$out["stray_output"] = ob_get_clean();
|
|
// If exited, ob would have file_gen response. Otherwise, fall through
|
|
echo json_encode($out);
|