'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);