Fix step 5 ConfigGenerator call and add generateAndApply static helper

This commit is contained in:
sorcier committed 2026-11-02 03:39:35 +01:00
1 parent 2be6e66300
commit fb0997e759
2 files changed
+11 -1

No files matched your search

+2 -1
View File
@@ -284,7 +284,8 @@ if ($st) {
} }
// Génération initiale de pjsip.conf et extensions.conf // Génération initiale de pjsip.conf et extensions.conf
App\ConfigGenerator::generateAndApply($db); $generator = new App\ConfigGenerator($db);
$generator->writeAllConfigs();
// Initialisation de l annuaire et synchronisation // Initialisation de l annuaire et synchronisation
App\PhonebookManager::initDirectory(); App\PhonebookManager::initDirectory();
+9
View File
@@ -20,6 +20,15 @@ class ConfigGenerator
public function __construct(private PDO $db) {} public function __construct(private PDO $db) {}
/**
* Helper statique pour générer et appliquer toutes les configurations Asterisk.
*/
public static function generateAndApply(PDO $db): array
{
$generator = new self($db);
return $generator->writeAllConfigs();
}
/** /**
* Génère le contenu complet de /etc/asterisk/pjsip.custom.conf * Génère le contenu complet de /etc/asterisk/pjsip.custom.conf
*/ */