<?php
require 'config.php';
header('Content-Type: text/plain');

$output = "=== LISTE DES MODULES SERVEUR ===\n";
$stmt = $pdo->query("SELECT * FROM modules");
$modules = $stmt->fetchAll(PDO::FETCH_ASSOC);

foreach ($modules as $m) {
    $output .= "[{$m['code']}] {$m['name']} (Core: {$m['is_core']})\n";
}
file_put_contents('debug_codes.txt', $output);
echo "Done.";

?>
