<?php
header('Content-Type: application/json');
session_start();

try {
    // Nettoyer les variables de session liées à la base de données
    unset($_SESSION['current_db_file']);
    session_write_close();
    
    echo json_encode([
        'success' => true,
        'message' => 'Successfully disconnected from database'
    ]);
} catch (Exception $e) {
    echo json_encode([
        'success' => false,
        'error' => $e->getMessage()
    ]);
}