<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
header('Content-Type: text/plain; charset=utf-8');

define('WIZWIZ_CRON', true);

try {
    require_once __DIR__ . '/config.php';
    echo "OK config.php\n";
    echo 'DB: ' . ($connection->ping() ? 'connected' : 'failed') . "\n";
    echo 'BOT_STATES: ' . (is_array($botState) ? 'loaded' : 'missing') . "\n";
    echo 'admin: ' . (string) $admin . "\n";
    echo "Services: BroadcastQueueService=" . (class_exists('BroadcastQueueService') ? 'yes' : 'no');
    echo ', CronScheduler=' . (class_exists('CronScheduler') ? 'yes' : 'no') . "\n";
} catch (Throwable $e) {
    http_response_code(500);
    echo "ERROR: " . $e->getMessage() . "\n";
    echo $e->getFile() . ':' . $e->getLine() . "\n";
}
