Skip to content

Commit

Permalink
Update info
Browse files Browse the repository at this point in the history
  • Loading branch information
mowangjuanzi committed Oct 16, 2023
1 parent bbac633 commit 61af489
Show file tree
Hide file tree
Showing 27 changed files with 94 additions and 50 deletions.
14 changes: 10 additions & 4 deletions reference/info/constants.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 389525942dd551c9b1943d404d76c03ab4a6203b Maintainer: daijie Status: ready -->
<!-- CREDITS: Luffy -->
<!-- EN-Revision: ada1d79de35239334b68d0120b011530e31244ff Maintainer: daijie Status: ready -->
<!-- CREDITS: Luffy, mowangjuanzi -->
<appendix xml:id="info.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.constants;
&extension.constants.core;
Expand Down Expand Up @@ -185,7 +185,7 @@
</table>

<simpara>
断言常量,这些值用于设置 <function>assert_options</function> 中的断言标记
断言常量,这些值用于设置 <function>assert_options</function> 中的断言标记。
</simpara>
<table>
<title><function>assert</function> 常量</title>
Expand All @@ -203,41 +203,47 @@
<entry><link linkend="ini.assert.active">assert.active</link></entry>
<entry>
启用 <function>assert</function>。
&warn.deprecated.feature-8-3-0;
</entry>
</row>
<row xml:id="constant.assert-callback">
<entry><constant>ASSERT_CALLBACK</constant></entry>
<entry><link linkend="ini.assert.callback">assert.callback</link></entry>
<entry>
失败断言的回调函数。
&warn.deprecated.feature-8-3-0;
</entry>
</row>
<row xml:id="constant.assert-bail">
<entry><constant>ASSERT_BAIL</constant></entry>
<entry><link linkend="ini.assert.bail">assert.bail</link></entry>
<entry>
断言失败时中止执行。
&warn.deprecated.feature-8-3-0;
</entry>
</row>
<row xml:id="constant.assert-exception">
<entry><constant>ASSERT_EXCEPTION</constant></entry>
<entry><link linkend="ini.assert.exception">assert.exception</link></entry>
<entry>
为每个失败的断言产生一条 PHP 警告。
&warn.deprecated.feature-8-3-0;
</entry>
</row>
<row xml:id="constant.assert-warning">
<entry><constant>ASSERT_WARNING</constant></entry>
<entry><link linkend="ini.assert.warning">assert.warning</link></entry>
<entry>
为每个失败的断言产生一条 PHP 警告。
&warn.deprecated.feature-8-3-0;
</entry>
</row>
<row xml:id="constant.assert-quiet-eval">
<entry><constant>ASSERT_QUIET_EVAL</constant></entry>
<entry><link linkend="ini.assert.quiet-eval">assert.quiet_eval</link></entry>
<entry>
在执行断言表达式时禁用 <literal>error_reporting</literal>。自 PHP 8.0.0 起删除。
在执行断言表达式时禁用 <literal>error_reporting</literal>。
&warn.feature.removed-8-0-0;
</entry>
</row>
</tbody>
Expand Down
12 changes: 11 additions & 1 deletion reference/info/functions/assert-options.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 389525942dd551c9b1943d404d76c03ab4a6203b Maintainer: daijie Status: ready -->
<!-- EN-Revision: ada1d79de35239334b68d0120b011530e31244ff Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xml:id="function.assert-options" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>assert_options</refname>
<refpurpose>设置/获取各种断言 flag</refpurpose>
</refnamediv>

<refsynopsisdiv>
&warn.deprecated.function-8-3-0;
</refsynopsisdiv>

<refsect1 role="description">
&reftitle.description;
Expand Down Expand Up @@ -176,6 +180,12 @@
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
<function>assert_option</function> 现在已弃用。
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
25 changes: 20 additions & 5 deletions reference/info/functions/assert.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: bfabdf420fa4c710ec5995480dd7cbc17abdbada Maintainer: daijie Status: ready -->
<!-- EN-Revision: ada1d79de35239334b68d0120b011530e31244ff Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xml:id="function.assert" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -70,7 +70,9 @@
<entry>
&false; 时,<function>assert</function> 将不会检查预期(expectation)并且无条件返回 &true;
</entry>
<entry/>
<entry>
自 PHP 8.3.0 起弃用
</entry>
</row>
<row>
<entry><link linkend="ini.assert.callback">assert.callback</link></entry>
Expand All @@ -94,6 +96,7 @@
<methodparam><type>string</type><parameter>assertion</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>description</parameter></methodparam>
</methodsynopsis>
自 PHP 8.3.0 起弃用
</entry>
</row>
<row>
Expand All @@ -102,15 +105,19 @@
<entry>
如果为 &true;,则如果不能满足预期(expectations),将抛出 <classname>AssertionError</classname> 异常。
</entry>
<entry/>
<entry>
自 PHP 8.3.0 起弃用
</entry>
</row>
<row>
<entry><link linkend="ini.assert.bail">assert.bail</link></entry>
<entry>&false;</entry>
<entry>
&true; 时,如果预期(expectation)不支持,将会中止 PHP 脚本的执行。
</entry>
<entry/>
<entry>
自 PHP 8.3.0 起弃用
</entry>
</row>
<row>
<entry><link linkend="ini.assert.warning">assert.warning</link></entry>
Expand All @@ -119,7 +126,9 @@
&true; 时,则如果预期(expectation)不支持,将发出 <constant>E_WARNING</constant> 警告。如果启用了
<link linkend="ini.assert.exception">assert.exception</link>,此 INI 设置将无效。
</entry>
<entry/>
<entry>
自 PHP 8.3.0 起弃用
</entry>
</row>
</tbody>
</tgroup>
Expand Down Expand Up @@ -206,6 +215,12 @@
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
弃用所有的 <literal>assert.</literal> INI 设置。
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/dl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
&reftitle.examples;
<para>
<example>
<title><function>dl</function> 例子</title>
<title><function>dl</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
// 加载一个扩展的例子,基于操作系统
// 加载一个扩展的示例,基于操作系统
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/extension-loaded.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ctype
&reftitle.examples;
<para>
<example>
<title><function>extension_loaded</function> 例子</title>
<title><function>extension_loaded</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/gc-enabled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
&reftitle.examples;
<para>
<example>
<title>一个 <function>gc_enabled</function> 例子</title>
<title><function>gc_enabled</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/get-current-user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
&reftitle.examples;
<para>
<example>
<title><function>get_current_user</function> 例子</title>
<title><function>get_current_user</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/get-defined-constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Array
&reftitle.examples;
<para>
<example>
<title><function>get_defined_constants</function> 例子</title>
<title><function>get_defined_constants</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/get-include-path.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
&reftitle.examples;
<para>
<example>
<title><function>get_include_path</function> 例子</title>
<title><function>get_include_path</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/getenv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
&reftitle.examples;
<para>
<example>
<title><function>getenv</function> 例子</title>
<title><function>getenv</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/getlastmod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
&reftitle.examples;
<para>
<example>
<title><function>getlastmod</function> 例子</title>
<title><function>getlastmod</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
8 changes: 4 additions & 4 deletions reference/info/functions/getopt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
&reftitle.examples;
<para>
<example xml:id="getopt.examples-1">
<title><function>getopt</function> 例子:基本用法</title>
<title><function>getopt</function> 示例:基本用法</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -164,7 +164,7 @@ array(2) {
</para>
<para>
<example xml:id="getopt.examples-2">
<title><function>getopt</function> 例子:引入长选项</title>
<title><function>getopt</function> 示例:引入长选项</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -213,7 +213,7 @@ array(6) {
</para>
<para>
<example xml:id="getopt.examples-3">
<title><function>getopt</function> 例子:传递同一多个选项</title>
<title><function>getopt</function> 示例:传递同一多个选项</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -250,7 +250,7 @@ array(2) {
</para>
<para>
<example xml:id="getopt.examples-4">
<title><function>getopt</function> 例子:使用 <parameter>rest_index</parameter></title>
<title><function>getopt</function> 示例:使用 <parameter>rest_index</parameter></title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/getrusage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
&reftitle.examples;
<para>
<example>
<title><function>getrusage</function> 例子</title>
<title><function>getrusage</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/ini-get-all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
&reftitle.examples;
<para>
<example>
<title><function>ini_get_all</function> 例子</title>
<title><function>ini_get_all</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
6 changes: 3 additions & 3 deletions reference/info/functions/ini-get.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
&reftitle.examples;
<para>
<example>
<title>一些 <function>ini_get</function> 例子</title>
<title>一些 <function>ini_get</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -114,12 +114,12 @@ post_max_size in bytes = 8388608
许多内存尺寸的 ini 值,类似 <link linkend="ini.upload-max-filesize">upload_max_filesize</link> 是以简写表示法储存在 &php.ini; 文件里。
<function>ini_get</function> 会返回 &php.ini; 文件中储存的确切字符串,而<emphasis>不是</emphasis>它的等量 <type>int</type>。
尝试对这些值使用常规算术运算函数将不会得到预期的结果。
以上例子显示了转换简写表示法为字节的一种方式,和 PHP 源码所做的比较像。
以上示例显示了转换简写表示法为字节的一种方式,和 PHP 源码所做的比较像。
</para>
</note>
<note>
<para>
<function>ini_get</function> 无法读取 "array" 的 ini 选项,例如 pdo.dsn.*,在这个例子中会返回 &false;
<function>ini_get</function> 无法读取 "array" 的 ini 选项,例如 pdo.dsn.*,在这个示例中会返回 &false;
</para>
</note>
</refsect1>
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/ini-restore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
&reftitle.examples;
<para>
<example>
<title><function>ini_restore</function> 例子</title>
<title><function>ini_restore</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/memory-get-usage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
&reftitle.examples;
<para>
<example>
<title>一个 <function>memory_get_usage</function> 例子</title>
<title>一个 <function>memory_get_usage</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
//这只是个例子,下面的数字取决于你的系统
//这只是个示例,下面的数字取决于你的系统
echo memory_get_usage() . "\n"; // 36640
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/php-ini-loaded-file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
&reftitle.examples;
<para>
<example>
<title><function>php_ini_loaded_file</function> 例子</title>
<title><function>php_ini_loaded_file</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
2 changes: 1 addition & 1 deletion reference/info/functions/php-ini-scanned-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
&reftitle.examples;
<para>
<example>
<title>列出返回的 ini 文件的简单例子</title>
<title>列出返回的 ini 文件的简单示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/php-sapi-name.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
&reftitle.examples;
<para>
<example>
<title><function>php_sapi_name</function> 例子</title>
<title><function>php_sapi_name</function> 示例</title>
<para>
以下例子检测了子字符串 <literal>cgi</literal>,因为它也有可能会是 <literal>cgi-fcgi</literal>。
以下示例检测了子字符串 <literal>cgi</literal>,因为它也有可能会是 <literal>cgi-fcgi</literal>。
</para>
<programlisting role="php">
<![CDATA[
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/php-uname.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
&reftitle.examples;
<para>
<example>
<title>一些 <function>php_uname</function> 的例子</title>
<title>一些 <function>php_uname</function> 的示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -120,7 +120,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
<para>
同样可以方便地使用一些相关的 <link linkend="language.constants.predefined">PHP 预定义常量</link>,例如:
<example>
<title>一些系统相关常量的例子</title>
<title>一些系统相关常量的示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down
Loading

0 comments on commit 61af489

Please sign in to comment.