final public static function create(array $params, $adapter = null)
    {
        $adapter = isset($params['_adapter']) ? $params['_adapter'] : $adapter;
        $adapter = strtolower($adapter);
        $classname = __NAMESPACE__.'\\Adapters\\'.ucfirst($adapter);
        if (!class_exists($classname, true)) {
            throw new UnknownAdapter($adapter);
        }
        $params['_adapter'] = $adapter;
        return (new $classname($params));
    }
final public static function create(array $params, $adapter = null)
    {
        $adapter = isset($params['_adapter']) ? $params['_adapter'] : $adapter;
        $adapter = strtolower($adapter);
        $classname = __NAMESPACE__.'\\Adapters\\'.ucfirst($adapter);
        if (!class_exists($classname, true)) {
            throw new UnknownAdapter($adapter);
        }
        $params['_adapter'] = $adapter;
        return (new $classname($params));
    }
final public static function create ( array $ params , $ adapter = null ) { $ adapter = isset ( $ params [ '_adapter' ] ) ? $ params [ '_adapter' ] : $ adapter ; $ adapter = strtolower ( $ adapter ) ; $ classname = __NAMESPACE__ . '\\Adapters\\' . ucfirst ( $ adapter ) ; if ( ! class_exists ( $ classname , true ) ) { throw new UnknownAdapter ( $ adapter ) ; } $ params [ '_adapter' ] = $ adapter ; return ( new $ classname ( $ params ) ) ; }
Creates an instance for database access

@param array $params
database connection parameters
@param string $adapter [optional]
a name of a db-adapter (if it not specified in $params)
@return \go\DB\DB
the instance for database access
@throws \go\DB\Exceptions\Config
parameters is invalid
@throws \go\DB\Exceptions\Connect
a connection error
Creates an instance for database access