value pairs). * @throws ezcDbException::MISSING_DATABASE_NAME if database name is not specified in $params */ public function __construct( $dbParams ) { $database = null; $charset = null; $host = null; $port = null; $socket = null; foreach ( $dbParams as $key => $val ) { switch ( $key ) { case 'database': case 'dbname': $database = $val; break; case 'host': case 'hostspec': $host = $val; break; case 'port': $port = $val; break; } } if ( !isset( $database ) ) { throw new ezcDbException( ezcDbException::MISSING_DATABASE_NAME ); } $dsn = "pgsql:dbname=$database"; if ( isset( $host ) && $host ) { $dsn .= " host=$host"; } if ( isset( $port ) && $port ) { $dsn .= " port=$port"; } parent::__construct( $dbParams, $dsn ); } static public function getName() { return 'pgsql'; } /** * Returns a new ezcQuery derived object for this database instance. * * @returns ezcQueryPgsql */ public function createQuery() { return new ezcQueryPgsql( $this ); } /** * Returns a new ezcUtilities derived object for this database instance. * * @returns ezcUtilitiesPgsql */ public function createUtilities() { return new ezcDbUtilitiesPgsql( $this ); } } ?>