public static function castLink($link, array $a, Stub $stub, $isNested) { $a['status'] = pg_connection_status($link); $a['status'] = new ConstStub(PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']); $a['busy'] = pg_connection_busy($link); $a['transaction'] = pg_transaction_status($link); if (isset(self::$transactionStatus[$a['transaction']])) { $a['transaction'] = new ConstStub(self::$transactionStatus[$a['transaction']], $a['transaction']); } $a['pid'] = pg_get_pid($link); $a['last error'] = pg_last_error($link); $a['last notice'] = pg_last_notice($link); $a['host'] = pg_host($link); $a['port'] = pg_port($link); $a['dbname'] = pg_dbname($link); $a['options'] = pg_options($link); $a['version'] = pg_version($link); foreach (self::$paramCodes as $v) { if (false !== ($s = pg_parameter_status($link, $v))) { $a['param'][$v] = $s; } } $a['param']['client_encoding'] = pg_client_encoding($link); $a['param'] = new EnumStub($a['param']); return $a; }
public function getConnInfo() { $item = $this->resultQuery('SHOW SERVER_VERSION'); return 'PostgreSQL ' . (($host = pg_host($this->db)) === '' ? 'local' : "{$host}:" . pg_port($this->db)) . " ({$item['0']})"; }
public function Port() { return pg_port($this->connection); }
echo "pg_connection_status() error\n"; } if (!pg_connection_reset($db)) { echo "pg_connection_reset() error\n"; } if (pg_connection_busy($db)) { echo "pg_connection_busy() error\n"; } if (function_exists('pg_transaction_status')) { if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE) { echo "pg_transaction_status() error\n"; } } if (false === pg_host($db)) { echo "pg_host() error\n"; } if (!pg_dbname($db)) { echo "pg_dbname() error\n"; } if (!pg_port($db)) { echo "pg_port() error\n"; } if (pg_tty($db)) { echo "pg_tty() error\n"; } if (pg_options($db)) { echo "pg_options() error\n"; } pg_close($db); ?> ===DONE===