Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions reference/pcntl/functions/pcntl-signal.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: b890f28c0c6d2856eadcdc34b3faf83a846b3d79 Maintainer: mowangjuanzi Status: ready -->
<!-- EN-Revision: e91b2dd2539f6be30b7db023d880de673fa50b62 Maintainer: mowangjuanzi Status: ready -->
<!-- CREDITS: Luffy -->
<refentry xml:id="function.pcntl-signal" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_signal</refname>
Expand Down Expand Up @@ -127,8 +128,7 @@
<programlisting role="php">
<![CDATA[
<?php
// 需要使用 ticks
declare(ticks = 1);
pcntl_async_signals(true);

// 信号处理函数
function sig_handler($signo)
Expand Down Expand Up @@ -181,13 +181,30 @@ echo "Done\n";
<para>
<function>pcntl_signal</function> 不堆叠信号处理程序,而是替换。
</para>
<refsect2>
<title>调度方式</title>
<para>
调度信号处理程序的方法有多种:
<simplelist>
<member>启用 <function>pcntl_async_signals</function> 异步调度。这是推荐方法</member>
<member>设置 <link linkend="control-structures.declare.ticks">tick</link> 频率</member>
<member>使用 <function>pcntl_signal_dispatch</function> 手动调度</member>
</simplelist>
</para>
<para>
当信号以异步方式或使用基于 tick 的执行调度时,阻塞函数(如 <function>sleep</function>)可能会被中断。
</para>
</refsect2>
</refsect1><!-- }}} -->

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link xlink:href="https://en.wikipedia.org/wiki/Signal_(IPC)">Signal (IPC)</link> on Wikipedia</member>
<member><function>pcntl_async_signals</function></member>
<member><function>pcntl_fork</function></member>
<member><function>pcntl_signal_dispatch</function></member>
<member><function>pcntl_waitpid</function></member>
</simplelist>
</para>
Expand Down
4 changes: 2 additions & 2 deletions reference/pcntl/functions/pcntl-waitpid.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 61374bbe228e8e9c55a24aba59a1e2bb2a871148 Maintainer: mowangjuanzi Status: ready -->
<!-- EN-Revision: a747e132c5506a0273c686cbe20e227c980d8ec7 Maintainer: mowangjuanzi Status: ready -->
<!-- CREDITS: Luffy -->
<refentry xml:id="function.pcntl-waitpid" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -49,7 +49,7 @@
<row>
<entry><literal>-1</literal></entry>
<entry>
等待任意子进程;与 wait 函数行为一致。
等待任意子进程;与 <function>pcntl_wait</function> 函数行为一致。
</entry>
</row>
<row>
Expand Down
9 changes: 5 additions & 4 deletions reference/reflection/propertyhooktype.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: bb7c286b13ab0b57d680f099cef5224348028a90 Maintainer: mowangjuanzi Status: ready -->
<reference xmlns="http://docbook.org/ns/docbook" xml:id="enum.reflection.propertyhooktype" role="enum">
<!-- EN-Revision: 0cc604f2db478345bff5ade4e191111d5cbfbd90 Maintainer: mowangjuanzi Status: ready -->
<!-- CREDITS: Luffy -->
<reference xmlns="http://docbook.org/ns/docbook" xml:id="enum.propertyhooktype" role="enum">
<title>PropertyHookType 枚举</title>
<titleabbrev>PropertyHookType</titleabbrev>

<partintro>
<section xml:id="enum.reflection.propertyhooktype.intro">
<section xml:id="enum.propertyhooktype.intro">
&reftitle.intro;
<simpara>
<enumname>PropertyHookType</enumname> 枚举列出了<link linkend="language.oop5.property-hooks">属性挂钩</link>的合法类型。
</simpara>
</section>

<section xml:id="enum.reflection.propertyhooktype.synopsis">
<section xml:id="enum.propertyhooktype.synopsis">
&reftitle.enumsynopsis;

<enumsynopsis>
Expand Down
4 changes: 2 additions & 2 deletions reference/var/functions/intval.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 18c4f78a828232c909056490ccf0a858d002e6ef Maintainer: daijie Status: ready -->
<!-- EN-Revision: ec0d6933217236658dd6615c0b2293e1469fd851 Maintainer: daijie Status: ready -->
<!-- CREDITS: Luffy -->
<refentry xml:id="function.intval" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -127,7 +127,7 @@
<![CDATA[
<?php
echo intval(42); // 42
echo intval(4.2); // 4
echo intval(4.7); // 4
echo intval('42'); // 42
echo intval('+42'); // 42
echo intval('-42'); // -42
Expand Down