isConfigured()) { throw new RuntimeException('Database config missing.'); } $pdo = $app['database']->pdo(); $pendingRfid = (int) $pdo->query( 'SELECT COUNT(*) FROM rfid_events WHERE status = "received"' )->fetchColumn(); $summary = [ 'timestamp' => gmdate(DATE_ATOM), 'pending_rfid_events' => $pendingRfid, 'notes' => [ 'In diesem MVP dient Cron als technischer Haken fuer spaetere Reminder, Exporte und RFID-Regeln.', ], ]; fwrite(STDOUT, json_encode($summary, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL); } catch (\Throwable $throwable) { fwrite(STDERR, $throwable->getMessage() . PHP_EOL); exit(1); } finally { if (is_file($lockFile)) { unlink($lockFile); } }