mirror of
https://github.com/php/doc-pl.git
synced 2026-04-28 01:03:15 +02:00
119 lines
3.8 KiB
XML
119 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 658c808b558cab3ab64cc86f55cc9056aa7818e6 Maintainer: sobak Status: ready -->
|
|
|
|
<refentry xml:id="function.sapi-windows-generate-ctrl-event" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>sapi_windows_generate_ctrl_event</refname>
|
|
<refpurpose>Wysyła zdarzenie CTRL do innego procesu</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>sapi_windows_generate_ctrl_event</methodname>
|
|
<methodparam><type>int</type><parameter>event</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>pid</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Wysyła zdarzenie CTRL do innego procesu w tej samej grupie procesów.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>event</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Zdarzenie <literal>CTRL</literal> do wysłania.
|
|
<constant>PHP_WINDOWS_EVENT_CTRL_C</constant> lub
|
|
<constant>PHP_WINDOWS_EVENT_CTRL_BREAK</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>pid</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
ID procesu, do którego wysłać zdarzenie. Jeśli podano <literal>0</literal>
|
|
to zdarzenie jest wysyłane do wszystkich procesów w grupie procesów.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="sapi-windows-generate-ctrl-event.example.basic">
|
|
<title>Podstawowy przykład użycia <function>sapi_windows_generate_ctrl_event</function></title>
|
|
<para>
|
|
This example shows how to pass along <literal>CTRL+BREAK</literal> events to a child
|
|
process. In this case the child process echoes <literal>I'm still alive</literal>
|
|
every second, until the user presses <literal>CTRL+BREAK</literal>, what causes
|
|
only the child process to be terminated.
|
|
|
|
Ten przykład pokazuje jak przekazać zdarzenia <literal>CTRL+BREAK</literal> do procesu
|
|
potomnego. W tym przypadku proces potomny wyświetla <literal>I'm still alive</literal>
|
|
co sekundę, dopóki użytkownik nie naciśnie <literal>CTRL+BREAK</literal>, co powoduje
|
|
zakończenie tylko procesu potomnego.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Przekieruj zdarzenia CTRL+BREAK do procesu potomnego
|
|
sapi_windows_set_ctrl_handler('sapi_windows_generate_ctrl_event');
|
|
|
|
// Stwórz proces potomny, który wyświetla tekst co sekundę
|
|
$cmd = ['php', '-r', 'while (true) { echo "I\'m still alive\n"; sleep(1); }'];
|
|
$descspec = array(['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']);
|
|
$options = ['create_process_group' => true];
|
|
$proc = proc_open($cmd, $descspec, $pipes, null, null, $options);
|
|
while (true) {
|
|
echo fgets($pipes[1]);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>proc_open</function></member>
|
|
<member><function>sapi_windows_set_ctrl_handler</function></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|