YANA 4 PHP FrameworkDocs For Class DbServer

### Class DbServer

#### Description

Connection to a database server

- name: class_dbserver
- access: public

Located in /includes/class_dbserver.php

#### Method Summary

DbServer DbServer ([array $dsn = null])
mixed &get ()
boolean test (string $dsn)

#### Methods

##### Constructor DbServer

DbServer DbServer ([array $dsn = null])

create a new instance

The $dsn parameter became available in version 2.8 It is an array containing the following information (all entries are optional):

-      string  ( DBMS )     default =  mysql      name of the php-dbms api to be used
                                                  e.g. mysql, mysqli, db2, ...

-      string  ( HOST )     default =  localhost  adress of the host e.g. localhost,
                                                  123.456.789.0,
                                                  COMPUTER-NAME\DB-INSTANCE (windows+MS-SQL)

-      integer ( PORT )     default =  0          port number

-      string  ( USERNAME ) default =  root

-      string  ( PASSWORD ) default =  n/a

-      string  ( DATABASE ) default =  yana       name of the database

The default settings may be changed by editing file config/system.config in key DEFAULT.DATABASE.DSN. The parameter $dsn has the following fall-back behaviour: $dsn -> global user settings -> yana default settings

- name: dbServer::__consruct()

Name | Type | Description
--- | --- | ---
$dsn | array | for a description of the $dsn parameter see the text above

##### get

mixed &get ()

get a PEAR-DB connection object

This function returns an open database connection via PEAR-DB. The returned values are:

-      null               = if PEAR-DB was not found

-      (boolean) false    = if the connection failed

-      (object) DB_common = if the connection was established successfully

- name: dbServer::get()
- access: public

##### test

boolean test (string $dsn)

test if a connection is available

returns (boolean) true if a connection to a db-server could be established via the provided parameters. See the constructor method for details on the $dsn parameter

- name: dbServer::test()
- static:
- access: public

Name | Type | Description
--- | --- | ---
$dsn | string | array

Documentation generated on Sat, 16 Sep 2006 17:05:56 +0200 by phpDocumentor 1.3.0RC4

yana author: Thomas Meyerwww.all-community.de/pub