query($query); } self::$initialized = true; } public static function tablesExist(): bool { global $db; $database = $db->escape_string($db->getDatabase()); $result = $db->query( "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$database}' AND table_name IN ( 'security_firewall_rules', 'security_policy_rules', 'security_policy_events', 'security_incidents', 'security_incident_notes' )" ); $row = $result ? $result->fetch_assoc() : ['count' => 0]; return (int)($row['count'] ?? 0) === 5; } }