13 lines
474 B
PHP
13 lines
474 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
header('Access-Control-Allow-Origin: *');
|
|
$dir = '/opt/weval-l99/kpi-cache';
|
|
if (!is_dir($dir)) { echo json_encode(['error' => 'kpi cache not initialized']); exit; }
|
|
$files = glob("$dir/*.json");
|
|
$all = [];
|
|
foreach ($files as $f) {
|
|
$j = json_decode(file_get_contents($f), true);
|
|
if ($j) $all[basename($f, '.json')] = $j;
|
|
}
|
|
echo json_encode(['ok' => true, 'modules' => count($all), 'data' => $all], JSON_PRETTY_PRINT);
|