Files
html/api/mirofish-ceo-cron.php
2026-04-12 22:57:03 +02:00

15 lines
817 B
PHP

<?php
// MiroFish CEO Cache — Cron */5
$MF = 'http://127.0.0.1:5001';
$health = @json_decode(@file_get_contents("$MF/health"), true);
$reports = @json_decode(@file_get_contents("$MF/api/report/list"), true);
$arch = @json_decode(@file_get_contents("/var/www/html/api/architecture-index.json"), true);
$cache = [
'mirofish' => ['status' => $health['status'] ?? 'unknown', 'reports' => $reports['count'] ?? 0],
'infrastructure' => ['score' => $arch['recommendations']['score'] ?? 0, 'docker' => count($arch['docker'] ?? [])],
'actions' => ['Generate prediction report', 'Chat with report', 'Run simulation', 'CEO insights'],
'timestamp' => date('Y-m-d H:i:s'),
];
file_put_contents('/var/www/html/api/mirofish-ceo-cache.json', json_encode($cache, JSON_PRETTY_PRINT));
echo json_encode($cache) . "\n";