protected function parseConnectionString($string)
    {
        // preg_match('%^([^/]+?)://(?:([^/@:]*?)(?::([^/@:]+?))?@([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%'
        $matches = [];
        preg_match('%^([^/]+?)://(?:([^/@]*?)(?::([^/@:]+?)@)?([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%',
                   $string, $matches);
        return [
            'dbtype'   => $matches[1],
            'username' => $matches[2],
            'password' => $matches[3],
            'host'     => $matches[4],
            'port'     => $matches[5],
            'database' => $matches[6]
        ];
    }
protected function parseConnectionString($string)
    {
        // preg_match('%^([^/]+?)://(?:([^/@:]*?)(?::([^/@:]+?))?@([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%'
        $matches = [];
        preg_match('%^([^/]+?)://(?:([^/@]*?)(?::([^/@:]+?)@)?([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%',
                   $string, $matches);
        return [
            'dbtype'   => $matches[1],
            'username' => $matches[2],
            'password' => $matches[3],
            'host'     => $matches[4],
            'port'     => $matches[5],
            'database' => $matches[6]
        ];
    }
protected function parseConnectionString ( $ string ) { // preg_match('%^([^/]+?)://(?:([^/@:]*?)(?::([^/@:]+?))?@([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%' $ matches = [ ] ; preg_match ( '%^([^/]+?)://(?:([^/@]*?)(?::([^/@:]+?)@)?([^/@:]+?)(?::([^/@:]+?))?)?/(.+)$%' , $ string , $ matches ) ; return [ 'dbtype' => $ matches [ 1 ] , 'username' => $ matches [ 2 ] , 'password' => $ matches [ 3 ] , 'host' => $ matches [ 4 ] , 'port' => $ matches [ 5 ] , 'database' => $ matches [ 6 ] ] ; }
Parses a connection string
Parses a connection string