Git - Framework SuperObject

fso: / db_pgsql.php [ Download ]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

if ( !class_exists('FSO') )
    die('Framework SuperObject base class must be loaded to use its modules!');

class DB_pgsql extends FSO_DB_Module
{
    //  {{{ public function __construct( $conf )

    /**
     * Constructor
     *
     * Set up database connection.  $conf must be an array containing at least
     * 'user', 'pass' and 'db' parameters.
     *
     * @param       array       $conf
     * @return      void
     */
    public function __construct( $conf )
    {
        $conf = array_merge(array(
            'host'  => 'localhost',
            'port'  => '5432',
        ), $conf);
        parent::__construct("pgsql:host={$conf['host']};dbname={$conf['db']};port={$conf['port']}", $conf['user'], $conf['pass']);
    }

    //  }}}
}

?>