<?php

namespace classes;

class releasemanager
{
    public function isEnabled(): bool
    {
        try {
            release_manager_schema_bootstrap::ensureTables();
            global $db;
            $result = $db->query("SELECT value FROM module_config WHERE module = 'ReleaseManager' AND variable = 'enabled' LIMIT 1");
            $row = $result ? $result->fetch_assoc() : null;
            return in_array(strtolower(trim((string)($row['value'] ?? 'true'))), ['1', 'true', 'yes', 'on'], true);
        } catch (\Throwable) {
            return true;
        }
    }
}
