Commit 4f4d4894 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

[Fix] Pb de chargement de config simplifiée

parent 249221cb
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -154,15 +154,16 @@ class Bdd
    public function __construct(array $options = [], ?string $connection = null)
    {
        if (!empty($options)) {
            if (empty($connection)){
                $connection = $this->getOption(self::OPTION_CURRENT_CONNECTION, 'default');
            }

            // Compatibilité avec l'ancienne configuration des connexions
            if (!isset($options[self::OPTION_CONNECTION]) && isset($options['host'])) {
                $options = [self::OPTION_CONNECTION => [$connection => $options]];
            }
            $this->setOptions($options);

            if (empty($connection)){
                $connection = $this->getOption(self::OPTION_CURRENT_CONNECTION, 'default');
            }
            $this->connection = $connection;
            
            $this->connect();