15 lines
846 B
PHP
Executable File
15 lines
846 B
PHP
Executable File
<?php
|
|
error_reporting(0);
|
|
header("Content-Type: application/json");
|
|
require_once("/opt/wevads/config/credentials.php");
|
|
$tests=[]; $ok=0; $total=0;
|
|
// DB connection test
|
|
$total++; try { $pdo=get_pdo("adx_system"); $ok++; $tests["db"]="ok"; } catch(Exception $e) { $tests["db"]="fail: ".$e->getMessage(); }
|
|
// HAMID API test
|
|
$total++; $h=@file_get_contents("http://localhost:5821/hamid-api.php"); $tests["hamid"]=$h?"ok":"fail"; if($h)$ok++;
|
|
// Brain Engine test
|
|
$total++; $b=@file_get_contents("http://localhost:5890/api/brain-combo.php"); $tests["brain"]=$b?"ok":"fail"; if($b)$ok++;
|
|
// Arsenal API test
|
|
$total++; $a=@file_get_contents("http://localhost:5890/api/index.php"); $tests["arsenal"]=$a?"ok":"fail"; if($a)$ok++;
|
|
echo json_encode(["status"=>"success","tests"=>$tests,"passed"=>$ok,"total"=>$total,"score"=>round($ok/$total*100)."%"]);
|