mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 07:02:08 +01:00
find . -type f -name "*.xml" -print0 | xargs -0 sed -i -e "s/\(サーバ\)\([^ー]\)/サーバー\2/g" closes: #69
133 lines
3.5 KiB
XML
133 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: cfeb14a38b666f6a3fc73da70f4a90fbe115e53f Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: takagi -->
|
|
<refentry xml:id="function.pg-get-notify" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>pg_get_notify</refname>
|
|
<refpurpose>SQL NOTIFY メッセージを取得する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>false</type></type><methodname>pg_get_notify</methodname>
|
|
<methodparam><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>PGSQL_ASSOC</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_get_notify</function>は、<literal>NOTIFY</literal> SQL
|
|
コマンドにより送信された通知メッセージを取得します。
|
|
通知メッセージを取得するには、<literal>LISTEN</literal> SQL
|
|
コマンドを発行する必要があります。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>connection</parameter></term>
|
|
<listitem>
|
|
&pgsql.parameter.connection;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
&pgsql.parameter.mode;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<literal>NOTIFY</literal> メッセージ名とバックエンドの PID を含む
|
|
配列を返します。
|
|
サーバーでサポートされている場合は、
|
|
配列にはサーバーのバージョンおよびペイロードも含まれます。
|
|
もし待ち受ける <literal>NOTIFY</literal> が存在しない場合は、
|
|
&false; を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&pgsql.changelog.connection-object;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>PostgreSQL NOTIFY メッセージ</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$conn = pg_pconnect("dbname=publisher");
|
|
if (!$conn) {
|
|
echo "An error occurred.\n";
|
|
exit;
|
|
}
|
|
|
|
// 他のプロセスからの 'author_updated' メッセージを監視する
|
|
pg_query($conn, 'LISTEN author_updated;');
|
|
$notify = pg_get_notify($conn);
|
|
if (!$notify) {
|
|
echo "No messages\n";
|
|
} else {
|
|
print_r($notify);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>pg_get_pid</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|