<?php
declare(strict_types=1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

echo "Script started OK<br>";

require_once __DIR__ . '/lib/db.php';
echo "db.php loaded OK<br>";

require_once __DIR__ . '/lib/settings.php';
echo "settings.php loaded OK<br>";

$rows = db()->query("SELECT key, value FROM settings WHERE key LIKE '%sport%'")->fetchAll();
echo "<pre>Current sport-related settings:\n";
print_r($rows);
echo "</pre>";

if (isset($_GET['fix'])) {
    settings_set('sport_enabled', '1');
    echo "<p><strong>Set sport_enabled = 1.</strong></p>";
}