common.helper.dsn
[ class tree: common.helper.dsn ] [ index: common.helper.dsn ] [ all elements ]

Class: DsnHelper

Source Location: /helper/database/DsnHelper.class.php

Class Overview

Helper
   |
   --DsnHelper

DsnHelper provides a simple Dsn parser


Author(s):

  • Tyler Tompkins (ttompkins@mojavi.org)

Methods


Inherited Variables

Inherited Methods


Class Details

[line 21]
DsnHelper provides a simple Dsn parser



Tags:

since:  4.0.0 $Id$
author:  Tyler Tompkins (ttompkins@mojavi.org)


[ Top ]


Class Methods


method parseDsn [line 60]

array parseDsn( string $dsn)

Parse a data source name

Additional keys can be added by appending a URI query string to the end of the DSN.

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

  1. phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true

Most variations are allowed:

  1. phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
  2. phptype://username:password@hostspec/database_name
  3. phptype://username:password@hostspec
  4. phptype://username@hostspec
  5. phptype://hostspec/database
  6. phptype://hostspec
  7. phptype(dbsyntax)
  8. phptype




Tags:

return:  an associative array with the following keys:
  • phptype: Database backend used in PHP (mysql, odbc etc.)
  • dbsyntax: Database used with regards to SQL syntax 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
access:  public
author:  PEAR::DB Developers


Parameters:

string   $dsn   Data Source Name to be parsed

[ Top ]


Documentation generated on Tue, 21 Feb 2006 02:29:44 +0900 by phpDocumentor 1.3.0RC5