#!/usr/bin/env php [ 'host' => $databaseHost, 'dbname' => $databaseName, 'user' => $databaseUser, 'password' => $databasePassword ] ]; // Encode en JSON $jsonConfig = json_encode($configArray, JSON_PRETTY_PRINT); // Écrit le fichier de configuration JSON file_put_contents($configPath, $jsonConfig); echo "Le fichier de configuration a été créé avec succès.\n"; } } // Appel de la fonction pour créer le fichier de configuration $configPath = $homeDir . '/.config/fr.a5l.ytdll.json'; $templatePath = $homeDir . '/.local/share/ytdll/config.php'; createConfigFile($configPath, $templatePath); // -- DEBUT -- // Lit le fichier de configuration primaire $configContent = file_get_contents($configPath); // Décode le JSON en tableau associatif $config = json_decode($configContent, true); // Initialiser la connexion à la base de données $database = new Database($config['database']); unset($config); // Initialiser au gestionnaire de configuration $configManager = new Config($database); // -- GESTION DES VERSIONS de TABLE -- $updateManager = new UpdateManager($configManager, $pdo); $updateManager->manageVersionTables();