src/Db/MySQL/Drivers/MySQLi.php
public function loadConfig($config = null): void
    {
        $baseClass = Base::getInstance();
        $this->errorLevel = (string)$baseClass->Database->MySQL->errorLevel;

        if (\is_null($config)) {
            $config = $baseClass->Database->MySQL->defaultConnection;
        }
        if (!($config instanceof AbstractConfig)) {
            throw new RuntimeException('$config must be an instance of MS\LightFramework\Config\AbstractConfig');
        }

        $this->databaseHost = (string)$config->databaseHost;
        $this->databaseUser = (string)$config->databaseUser;
        $this->databasePass = (string)$config->databasePass;
        $this->databaseName = (string)$config->databaseName;
        $this->connectionCharset = (string)$config->connectionCharset;
        $this->connectionCollation = (string)$config->connectionCollation;

        $this->openConnection();
        $this->selectDatabase($this->databaseName);
        $this->setConnectionCharset($this->connectionCharset);
        $this->setConnectionCollation($this->connectionCollation);
    }
public function loadConfig($config = null): void
    {
        $baseClass = Base::getInstance();
        $this->errorLevel = (string)$baseClass->Database->MySQL->errorLevel;

        if (\is_null($config)) {
            $config = $baseClass->Database->MySQL->defaultConnection;
        }
        if (!($config instanceof AbstractConfig)) {
            throw new RuntimeException('$config must be an instance of MS\LightFramework\Config\AbstractConfig');
        }

        $this->databaseHost = (string)$config->databaseHost;
        $this->databaseUser = (string)$config->databaseUser;
        $this->databasePass = (string)$config->databasePass;
        $this->databaseName = (string)$config->databaseName;
        $this->connectionCharset = (string)$config->connectionCharset;
        $this->connectionCollation = (string)$config->connectionCollation;

        $this->openConnection();
        $this->selectDatabase($this->databaseName);
        $this->setConnectionCharset($this->connectionCharset);
        $this->setConnectionCollation($this->connectionCollation);
    }
public function loadConfig ( $ config = null ) : void { $ baseClass = Base :: getInstance ( ) ; $ this -> errorLevel = ( string ) $ baseClass -> Database -> MySQL -> errorLevel ; if ( \ is_null ( $ config ) ) { $ config = $ baseClass -> Database -> MySQL -> defaultConnection ; } if ( ! ( $ config instanceof AbstractConfig ) ) { throw new RuntimeException ( '$config must be an instance of MS\LightFramework\Config\AbstractConfig' ) ; } $ this -> databaseHost = ( string ) $ config -> databaseHost ; $ this -> databaseUser = ( string ) $ config -> databaseUser ; $ this -> databasePass = ( string ) $ config -> databasePass ; $ this -> databaseName = ( string ) $ config -> databaseName ; $ this -> connectionCharset = ( string ) $ config -> connectionCharset ; $ this -> connectionCollation = ( string ) $ config -> connectionCollation ; $ this -> openConnection ( ) ; $ this -> selectDatabase ( $ this -> databaseName ) ; $ this -> setConnectionCharset ( $ this -> connectionCharset ) ; $ this -> setConnectionCollation ( $ this -> connectionCollation ) ; }
Loads configuration, opens new connection, selects database and sets connection charset & collation.

@param mixed $config
Loads configuration opens new connection selects database and sets connection charset & collation .