Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
// {{{ MDB2_Connect_Test
3
/**
4
 * This is just a dummy class to perform the tests.
5
 */
6
class MDB2_Connect_Test
7
{
8
    var $_dsn;
9
    var $dbc;
10
 
11
    // {{{ constructor php5 valid
12
    /**
13
     * Straightforward? The constructor
14
     */
15
    function __construct()
16
    {
17
        require_once 'MDB2.php';
18
        require_once 'config.php';
19
 
20
        $this->_dsn = array(
21
                'phptype'  => DSN_PHPTYPE,
22
                'username' => DSN_USERNAME,
23
                'password' => DSN_PASSWORD,
24
                'hostspec' => DSN_HOSTNAME,
25
                'database' => DSN_DATABASE,
26
        );
27
 
28
    }
29
    // }}}
30
    // {{{ PHP4 constructor..
31
    function MDB2_Connect_Test()
32
    {
33
        $this->__construct($connect);
34
    }
35
    // }}}
36
    // {{{ connect
37
    function connect()
38
    {
39
        // connect to database
40
        $options = array(
41
            'portability' => (MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL),
42
        );
43
 
44
        $this->dbc =& MDB2::singleton($this->_dsn, $options);
45
        if (PEAR::isError($this->dbc)) {
46
            return $this->dbc;
47
        }
48
    }
49
    // }}}
50
}
51
// }}}
52
?>