< hostspec > Protocol Reference

Parse a data source name. More...


Detailed Description

Parse a data source name.

This isn't quite as powerful as DB::parseDSN(); it's also a lot simpler, a lot faster, and many fewer lines of code.

A array with the following keys will be returned: phptype: Database backend used in PHP (mysql, odbc etc.) protocol: Communication protocol to use (tcp, unix etc.) hostspec: Host specification (hostname[:port]) database: Database to use on the DBMS server username: User name for login password: Password for login

The format of the supplied DSN is in its fullest form:

phptype://username:password/database

Most variations are allowed:

phptype://username:password phptype://username:password/database_name phptype://username:password phptype://username phptype://hostspec/database phptype://hostspec phptype

Parameters:
string $dsn Data Source Name to be parsed
Returns:
array An associative array

The documentation for this protocol was generated from the following file:

Generated on Wed May 6 23:10:49 2009 for fareofficelib by  doxygen 1.5.8