array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.pg-tty.php', 1 => 'pg_tty', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'Funções PostgreSQL', ), 'prev' => array ( 0 => 'function.pg-transaction-status.php', 1 => 'pg_transaction_status', ), 'next' => array ( 0 => 'function.pg-unescape-bytea.php', 1 => 'pg_unescape_bytea', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pgsql/functions/pg-tty.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
pg_tty — Return the TTY name associated with the connection
pg_tty() returns the TTY name that server
side debugging output is sent to on the given PostgreSQL
connection
instance.
Nota:
pg_tty() is obsolete, since the server no longer pays attention to the TTY setting, but the function remains for backwards compatibility.
connection
Uma instância de PgSql\Connection.
Quando o parâmetro connection
for null
, a conexão padrão será usada.
A conexão padrão é a última conexão feita por pg_connect()
ou pg_pconnect().
A partir do PHP 8.1.0, usar a conexão padrão tornou-se defasado.
A string containing the debug TTY of the connection
.
Versão | Descrição |
---|---|
8.1.0 |
O parâmetro connection agora espera uma instância de PgSql\Connection;
anteriormente, um resource era esperado.
|
8.0.0 |
connection is now nullable.
|
Exemplo #1 pg_tty() example
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Server debug TTY is: " . pg_tty($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>