Skip to content

Commit 485359a

Browse files
committed
Update appendices
1 parent 9f7fbf4 commit 485359a

File tree

3 files changed

+698
-742
lines changed

3 files changed

+698
-742
lines changed

appendices/migration80/incompatible.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 61374bbe228e8e9c55a24aba59a1e2bb2a871148 Maintainer: avenger Status: ready -->
3+
<!-- EN-Revision: b94d63fc0884d83ba43433ab33cc4810d955bf6d Maintainer: avenger Status: ready -->
44
<!-- CREDITS: mowangjuanzi -->
55
<sect1 xml:id="migration80.incompatible" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<title>不向后兼容的变更</title>
@@ -1460,7 +1460,7 @@ echo file_get_contents('http://example.org', false, $ctx);
14601460
<title>XMLReader</title>
14611461

14621462
<para>
1463-
<methodname>XMLReader::open</methodname> 和 <methodname>XMLReader::xml</methodname>
1463+
<methodname>XMLReader::open</methodname> 和 <methodname>XMLReader::XML</methodname>
14641464
现在是静态方法。也可以作为实例方法调用,但如果继承类需要覆盖这些方法,要声明为 static。
14651465
</para>
14661466
</sect2>

appendices/migration84/new-features.xml

Lines changed: 58 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 8a9f4bd9d54a809d66f32d35ec60eb2b7353f76e Maintainer: mowangjuanzi Status: partial -->
2+
<!-- EN-Revision: 8a9f4bd9d54a809d66f32d35ec60eb2b7353f76e Maintainer: mowangjuanzi Status: ready -->
33
<sect1 xml:id="migration84.new-features">
44
<title>新功能</title>
55

@@ -195,33 +195,23 @@ $object = $reflector->newLazyGhost($initializer);
195195
</simpara>
196196

197197
<simpara>
198-
Added <constant>CURL_HTTP_VERSION_3</constant> and
199-
<constant>CURL_HTTP_VERSION_3ONLY</constant> constants (available
200-
since libcurl 7.66 and 7.88) as available options for
201-
<constant>CURLOPT_HTTP_VERSION</constant>.
198+
新增 <constant>CURL_HTTP_VERSION_3</constant> 和 <constant>CURL_HTTP_VERSION_3ONLY</constant>
199+
常量(自 libcurl 7.66 和 7.88 起可用)作为 <constant>CURLOPT_HTTP_VERSION</constant> 的可用选项。
202200
</simpara>
203201

204202
<simpara>
205-
Added <constant>CURLOPT_PREREQFUNCTION</constant> as a cURL option that
206-
accepts a <type>callable</type> to be called after the connection is made,
207-
but before the request is sent.
208-
This callable must return either <constant>CURL_PREREQFUNC_OK</constant> or
209-
<constant>CURL_PREREQFUNC_ABORT</constant> to allow or abort the request.
203+
新增 <constant>CURLOPT_PREREQFUNCTION</constant> 作为 cURL 选项,该选项接受在建立连接后但在发送请求之前调用的
204+
<type>callable</type>。此 callable 必须返回 <constant>CURL_PREREQFUNC_OK</constant> 或
205+
<constant>CURL_PREREQFUNC_ABORT</constant> 以允许或中止请求。
210206
</simpara>
211207

212208
<simpara>
213-
Added <constant>CURLOPT_SERVER_RESPONSE_TIMEOUT</constant>,
214-
which was formerly known as <constant>CURLOPT_FTP_RESPONSE_TIMEOUT</constant>.
215-
Both constants hold the same value.
209+
新增 CURLOPT_SERVER_RESPONSE_TIMEOUT,以前称为 <constant>CURLOPT_FTP_RESPONSE_TIMEOUT</constant>。两个常量都具有相同的值。
216210
</simpara>
217211

218212
<para>
219-
Added <constant>CURLOPT_DEBUGFUNCTION</constant> as a cURL option that
220-
accepts a <type>callable</type> that gets called during the request lifetime
221-
with the <classname>CurlHandle</classname> object,
222-
an integer containing the debug message type, and a string containing the
223-
debug message.
224-
The debug message type is one of the following constants:
213+
新增 <constant>CURLOPT_DEBUGFUNCTION</constant> 作为 cURL 选项,该选项接受在请求生命周期内使用
214+
<classname>CurlHandle</classname> 对象调用的 <type>callable</type>、包含调试消息类型的整数以及包含调试消息的字符串。调试消息类型是以下常量之一:
225215
<simplelist>
226216
<member><constant>CURLINFO_TEXT</constant></member>
227217
<member><constant>CURLINFO_HEADER_IN</constant></member>
@@ -231,19 +221,14 @@ $object = $reflector->newLazyGhost($initializer);
231221
<member><constant>CURLINFO_SSL_DATA_IN</constant></member>
232222
<member><constant>CURLINFO_SSL_DATA_OUT</constant></member>
233223
</simplelist>
234-
Once this option is set, <constant>CURLINFO_HEADER_OUT</constant>
235-
must not be set because it uses the same libcurl functionality.
224+
一旦设置了此选项,就不能设置 <constant>CURLINFO_HEADER_OUT</constant>,因为它使用相同的 libcurl 功能。
236225
</para>
237226

238227
<simpara>
239-
The <function>curl_getinfo</function> now returns an additional
240-
<literal>posttransfer_time_us</literal> key, containing the number of
241-
microseconds from the start until the last byte is sent.
242-
When a redirect is followed, the time from each request is added together.
243-
This value can also be retrieved by passing
244-
<constant>CURLINFO_POSTTRANSFER_TIME_T</constant> to the
245-
<function>curl_getinfo</function> <parameter>option</parameter> parameter.
246-
This requires libcurl 8.10.0 or later.
228+
<function>curl_getinfo</function> 现在返回一个额外的 <literal>posttransfer_time_us</literal>
229+
key,其中包含从开始到发送最后一个字节的微秒数。当重定向之后,每个请求的时间都会加在一起。也可以通过将
230+
<constant>CURLINFO_POSTTRANSFER_TIME_T</constant> 传递给 <function>curl_getinfo</function>
231+
<parameter>option</parameter> 参数来检索此值。这需要 libcurl 8.10.0 或更高版本。
247232
</simpara>
248233
</sect2>
249234

@@ -284,50 +269,38 @@ $object = $reflector->newLazyGhost($initializer);
284269
<title>Intl</title>
285270

286271
<simpara>
287-
Added the <constant>NumberFormatter::ROUND_HALFODD</constant> to
288-
complement the existing <constant>NumberFormatter::ROUND_HALFEVEN</constant>
289-
functionality.
272+
新增 <constant>NumberFormatter::ROUND_HALFODD</constant> 来补充现有的 <constant>NumberFormatter::ROUND_HALFEVEN</constant> 功能。
290273
</simpara>
291274
</sect2>
292275

293276
<sect2 xml:id="migration84.new-features.openssl">
294277
<title>OpenSSL</title>
295278

296279
<simpara>
297-
Added support for Curve25519 + Curve448 based keys.
298-
Specifically x25519, ed25519, x448 and ed448 fields are supported in
299-
<function>openssl_pkey_new</function>,
300-
<function>openssl_pkey_get_details</function>,
301-
<function>openssl_sign</function>, and
302-
<function>openssl_verify</function> were extended to support those keys.
280+
添加了对基于 Curve25519 + Curve448 密钥的支持。具体来说
281+
<function>openssl_pkey_new</function>、<function>openssl_pkey_get_details</function>、<function>openssl_sign</function> 和
282+
<function>openssl_verify</function> 中支持 x25519、ed25519、x448 和 ed448 字段,并进行了扩展以支持这些密钥。
303283
</simpara>
304284

305285
<simpara>
306-
Implement PASSWORD_ARGON2 password hashing.
307-
Requires OpenSSL 3.2 and NTS build.
286+
实现 PASSWORD_ARGON2 密码哈希处理。需要 OpenSSL 3.2 和 NTS 版本。
308287
</simpara>
309288
</sect2>
310289

311290
<sect2 xml:id="migration84.new-features.pcre">
312291
<title>PCRE</title>
313292

314293
<simpara>
315-
The bundled pcre2lib has been updated to version 10.44.
316-
As a consequence, LoongArch JIT support has been added, spaces
317-
are now allowed between braces in Perl-compatible items, and
318-
variable-length lookbehind assertions are now supported.
294+
捆绑的 pcre2lib 已更新至 10.44 版本。因此,添加了 LoongArch JIT 支持,现在允许在与 Perl 兼容项目中的花括号之间使用空格,并且现在支持可变长度的后向断言。
319295
</simpara>
320296

321297
<simpara>
322-
With pcre2lib version 10.44, the maximum length of named capture groups
323-
has changed from <literal>32</literal> to <literal>128</literal>.
298+
随着 pcre2lib 版本 10.44 的推出,命名捕获组的最大长度已从 <literal>32</literal> 更改为 <literal>128</literal>。
324299
</simpara>
325300

326301
<simpara>
327-
Added support for the <literal>r</literal> (PCRE2_EXTRA_CASELESS_RESTRICT)
328-
modifier, as well as the <literal>(?r)</literal> mode modifier.
329-
When enabled along with the case-insensitive modifier (<literal>i</literal>),
330-
the expression locks out mixing of ASCII and non-ASCII characters.
302+
添加了对 <literal>r</literal>(PCRE2_EXTRA_CASELESS_RESTRICT)修饰符以及 <literal>(?r)</literal>
303+
模式修饰符的支持。当与不区分大小写的修饰符 (<literal>i</literal>) 一起启用时,表达式会阻止 ASCII 和非 ASCII 字符的混合。
331304
</simpara>
332305
</sect2>
333306

@@ -336,24 +309,19 @@ $object = $reflector->newLazyGhost($initializer);
336309

337310
<!-- RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses -->
338311
<simpara>
339-
Added support for driver-specific subclasses.
340-
This RFC adds subclasses for PDO in order to better support
341-
database-specific functionalities.
342-
The new classes are instantiatable either via calling the
343-
<methodname>PDO::connect</methodname> method or by instantiating an instance
344-
of the driver-specific subclass directly.
312+
新增对特定驱动程序子类的支持。此 RFC 添加了 PDO 的子类,以便更好地支持特定于数据库的功能。新的类可通过调用 <methodname>PDO::connect</methodname>
313+
方法或直接实例化特定驱动程序子类的实例来实例化。
345314
</simpara>
346315

347316
<!-- RFC: https://wiki.php.net/rfc/pdo_driver_specific_parsers -->
348317
<para>
349-
Added support for driver specific SQL parsers.
350-
The default parser supports:
318+
新增对特定驱动程序的 SQL 解析器的支持。默认解析器支持:
351319
<simplelist>
352320
<member>
353-
single and double-quoted literals, with doubling as escaping mechanism
321+
单引号和双引号文字,使用双引号作为转义机制
354322
</member>
355323
<member>
356-
two-dashes and non-nested C-style comments
324+
双破折号和非嵌套的 C 风格注释
357325
</member>
358326
</simplelist>
359327
</para>
@@ -364,18 +332,16 @@ $object = $reflector->newLazyGhost($initializer);
364332

365333
<!-- RFC: https://wiki.php.net/rfc/pdo_driver_specific_parsers -->
366334
<para>
367-
Added a custom parser supporting:
335+
新增自定义解析器支持:
368336
<simplelist>
369337
<member>
370-
single and double-quoted literals, with doubling and backslash as escaping
371-
mechanism
338+
单引号和双引号文字,使用双引号作为转义机制
372339
</member>
373340
<member>
374-
backtick literal identifiers and with doubling as escaping mechanism
341+
反引号文字标识符并且双写反引号作为转义机制
375342
</member>
376343
<member>
377-
two dashes followed by at least 1 whitespace, non-nested C-style comments,
378-
and hash-comments
344+
两个破折号后跟至少 1 个空格、非嵌套的 C 风格注释和哈希注释(以 # 开头的注释)
379345
</member>
380346
</simplelist>
381347
</para>
@@ -386,23 +352,22 @@ $object = $reflector->newLazyGhost($initializer);
386352

387353
<!-- RFC: https://wiki.php.net/rfc/pdo_driver_specific_parsers -->
388354
<para>
389-
Added a custom parser supporting:
355+
新增自定义解析器支持:
390356
<simplelist>
391357
<member>
392-
single and double-quoted literals, with doubling as escaping mechanism
358+
单引号和双引号文字,使用双引号作为转义机制
393359
</member>
394360
<member>
395-
C-style "escape" string literals (<literal>E'string'</literal>)
361+
C 风格“转义”字符串文字(<literal>E'string'</literal>
396362
</member>
397363
<member>
398364
dollar-quoted string literals
399365
</member>
400366
<member>
401-
two-dashes and C-style comments (non-nested)
367+
双破折号和 C 风格注释(非嵌套)
402368
</member>
403369
<member>
404-
support for <literal>??</literal> as escape sequence for the
405-
<literal>?</literal> operator
370+
支持 <literal>??</literal> 作为 <literal>?</literal> 运算符的转义序列
406371
</member>
407372
</simplelist>
408373
</para>
@@ -413,17 +378,16 @@ $object = $reflector->newLazyGhost($initializer);
413378

414379
<!-- RFC: https://wiki.php.net/rfc/pdo_driver_specific_parsers -->
415380
<para>
416-
Added a custom parser supporting:
381+
新增自定义解析器支持:
417382
<simplelist>
418383
<member>
419-
single, double-quoted, and backtick literals, with doubling as
420-
escaping mechanism
384+
单引号、双引号和反引号文字,并带有转义机制
421385
</member>
422386
<member>
423-
square brackets quoting for identifiers
387+
方括号引用标识符
424388
</member>
425389
<member>
426-
two-dashes and C-style comments (non-nested)
390+
双破折号和 C 风格注释(非嵌套)
427391
</member>
428392
</simplelist>
429393
</para>
@@ -433,31 +397,28 @@ $object = $reflector->newLazyGhost($initializer);
433397
<title>Phar</title>
434398

435399
<simpara>
436-
Added support for the Unix timestamp extension for Zip archives.
400+
Zip 档案新增对 Unix 时间戳扩展的支持。
437401
</simpara>
438402
</sect2>
439403

440-
<sect2 xml:id="migration84.new-features.readfile">
441-
<title>Readfile</title>
404+
<sect2 xml:id="migration84.new-features.readline">
405+
<title>Readline</title>
442406

443407
<simpara>
444-
Added ability to change the <literal>.php_history</literal> path through
445-
the <envar>PHP_HISTFILE</envar> environment variable.
408+
新增通过 <envar>PHP_HISTFILE</envar> 环境变量更改 <literal>.php_history</literal> 路径的功能。
446409
</simpara>
447410
</sect2>
448411

449-
<sect2 xml:id="migration84.new-features.readline">
450-
<title>Readline</title>
412+
<sect2 xml:id="migration84.new-features.reflection">
413+
<title>Reflection</title>
451414

452415
<simpara>
453-
<classname>ReflectionAttribute</classname> now contains a
454-
<property>name</property> property to improve the debugging experience.
416+
<classname>ReflectionAttribute</classname> 现在包含 <property>name</property> 属性,以改善调试体验。
455417
</simpara>
456418

457419
<simpara>
458-
<methodname>ReflectionClassConstant::__toString</methodname> and
459-
<methodname>ReflectionProperty::__toString</methodname> now returns the
460-
attached doc comments.
420+
<methodname>ReflectionClassConstant::__toString</methodname> 和
421+
<methodname>ReflectionProperty::__toString</methodname> 现在返回附加的文档注释。
461422
</simpara>
462423

463424
<!-- RFC: https://wiki.php.net/rfc/lazy-objects -->
@@ -521,7 +482,7 @@ $object = $reflector->newLazyGhost($initializer);
521482
</simpara>
522483

523484
<simpara>
524-
Session persistence now works with a shared session module.
485+
持久会话现在可与共享会话模块一起使用。
525486
</simpara>
526487
</sect2>
527488

@@ -531,42 +492,35 @@ $object = $reflector->newLazyGhost($initializer);
531492
<!-- RFC: https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum -->
532493
<simpara>
533494
<!-- Should this use <enumname> -->
534-
Added a new <classname>RoundingMode</classname> enum with clearer naming
535-
and improved discoverability compared to the
536-
<constant>PHP_ROUND_<replaceable>*</replaceable></constant> constants.
537-
Moreover, four new rounding modes were added which are only available via
538-
the new <classname>RoundingMode</classname> enum.
495+
新增 <classname>RoundingMode</classname> 枚举,与 <constant>PHP_ROUND_<replaceable>*</replaceable></constant>
496+
常量相比,其命名更清晰,可发现性更高。此外,还添加了四种新的舍入模式,这些模式仅可通过新的 <classname>RoundingMode</classname> 枚举使用。
539497
</simpara>
540498
</sect2>
541499

542500
<sect2 xml:id="migration84.new-features.xsl">
543501
<title>XSL</title>
544502

545503
<simpara>
546-
It is now possible to use parameters that contain both single and double
547-
quotes.
504+
现在可以使用包含单引号和双引号的参数。
548505
</simpara>
549506

550507
<!-- RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl -->
551508
<simpara>
552-
It is now possible to pass any callable to
553-
<methodname>XSLTProcessor::registerPhpFunctions</methodname>.
509+
现在可以将任何 callable 传递给 <methodname>XSLTProcessor::registerPhpFunctions</methodname>。
554510
<!-- TODO Mention XSLTProcessor::registerPHPFunctionNS ? -->
555511
</simpara>
556512

557513
<simpara>
558-
Added <property>XSLTProcessor::$maxTemplateDepth</property> and
559-
<property>XSLTProcessor::$maxTemplateVars</property>
560-
to control the recursion depth of XSL template evaluation.
514+
添加了 <property>XSLTProcessor::$maxTemplateDepth</property> 和 <property>XSLTProcessor::$maxTemplateVars</property>
515+
来控制 XSL 模板计算的递归深度。
561516
</simpara>
562517
</sect2>
563518

564519
<sect2 xml:id="migration84.new-features.zip">
565520
<title>Zip</title>
566521

567522
<simpara>
568-
Added the <constant>ZipArchive::ER_TRUNCATED_ZIP</constant>
569-
constant, which was added in libzip 1.11.
523+
新增 <constant>ZipArchive::ER_TRUNCATED_ZIP</constant> 常量,libzip 1.11 中添加。
570524
</simpara>
571525
</sect2>
572526

0 commit comments

Comments
 (0)