public function addConnection($name, $dsn, $username = null, $password = null, $options = [])
    {
        //default driver options
        static $defaultOptions = array(
            \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
            //PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        );
        if (isset($options['prefix'])) {
            $prefix = $options['prefix'];
            unset($options['prefix']);
        } else {
            $prefix = '';
        }
        $this->configs[$name] = [
            'dsn' => $dsn,
            'username' => $username,
            'password' => $password,
            'prefix' => $prefix,
            'options' => $options + $defaultOptions,
        ];

        return $this;
    }
public function addConnection($name, $dsn, $username = null, $password = null, $options = [])
    {
        //default driver options
        static $defaultOptions = array(
            \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
            //PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        );
        if (isset($options['prefix'])) {
            $prefix = $options['prefix'];
            unset($options['prefix']);
        } else {
            $prefix = '';
        }
        $this->configs[$name] = [
            'dsn' => $dsn,
            'username' => $username,
            'password' => $password,
            'prefix' => $prefix,
            'options' => $options + $defaultOptions,
        ];

        return $this;
    }
public function addConnection ( $ name , $ dsn , $ username = null , $ password = null , $ options = [ ] ) { //default driver options static $ defaultOptions = array ( \ PDO :: ATTR_ERRMODE => \ PDO :: ERRMODE_EXCEPTION , //PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, ) ; if ( isset ( $ options [ 'prefix' ] ) ) { $ prefix = $ options [ 'prefix' ] ; unset ( $ options [ 'prefix' ] ) ; } else { $ prefix = '' ; } $ this -> configs [ $ name ] = [ 'dsn' => $ dsn , 'username' => $ username , 'password' => $ password , 'prefix' => $ prefix , 'options' => $ options + $ defaultOptions , ] ; return $ this ; }
Add a new connection configuration

@param string $name
@param string $dsn
@param string $username
@param string $password
@param array $options
@return \Ark\Database\Connection
Add a new connection configuration