Index Documentation

DbBackends
in package

FinalYes

Provides a registry of database backends.

Table of Contents

Methods

__construct()  : mixed
backend()  : DbBackend
Creates a database backend information class from a scheme.
create()  : DbConnection
Creates a database connection from a DSN URI.
parse()  : DbConnectionInfo
Parses a DSN URI into a connection info class.
register()  : void
Registers a database backend with a protocol scheme.

Methods

__construct()

public __construct() : mixed
Tags
throws
RuntimeException

Will always throw because this is a static class exclusively.

backend()

Creates a database backend information class from a scheme.

public static backend(string $scheme) : DbBackend
Parameters
$scheme : string

Database protocol scheme.

Tags
throws
InvalidArgumentException

If $scheme is not a registered protocol scheme.

throws
RuntimeException

If the implementation class is not available or doesn't implement DbBackend.

Return values
DbBackend

Database backend information instance.

create()

Creates a database connection from a DSN URI.

public static create(string $uri) : DbConnection
Parameters
$uri : string

DSN URI.

Tags
throws
RuntimeException

If the requested database backend is not available.

Return values
DbConnection

Connection instance.

register()

Registers a database backend with a protocol scheme.

public static register(string $scheme, string $className) : void
Parameters
$scheme : string

URL scheme.

$className : string

Fully qualified class name of the backend.

Tags
throws
InvalidArgumentException

If $scheme is already registered.


        
On this page

Search results