svn: /phpdoc/ja/trunk/ language-snippets.ent reference/dir/functions/chdir.xml reference/dir/functions/chroot.xml reference/dir/functions/getcwd.xml
[email protected] (Yoshinari Takaoka)
| Newsgroups | php.doc.ja |
|---|---|
| Message-ID | <[email protected]> |
mumumu Fri, 19 Jun 2020 19:58:04 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=350055
Log:
Fix #79439: Warn about different behavior of chdir() under ZTS
In response to Bug #79439 (https://bugs.php.net/bug.php?id=79439), where a user
reported the (correct, but surprising) behavior of `chdir` as a bug.
Also warn that with ZTS, return value of getcwd() may differ from OS cwd,
and warn that chroot() is not available on ZTS builds.
Patch provided by Alex Dowad.
Bug: https://bugs.php.net/79439 (error getting bug information)
Changed paths:
U phpdoc/ja/trunk/language-snippets.ent
U phpdoc/ja/trunk/reference/dir/functions/chdir.xml
U phpdoc/ja/trunk/reference/dir/functions/chroot.xml
U phpdoc/ja/trunk/reference/dir/functions/getcwd.xml
Modified: phpdoc/ja/trunk/language-snippets.ent
===================================================================
--- phpdoc/ja/trunk/language-snippets.ent 2020-06-19 19:38:40 UTC (rev 350054)
+++ phpdoc/ja/trunk/language-snippets.ent 2020-06-19 19:58:04 UTC (rev 350055)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 349686 Maintainer: takagi Status: working -->
+<!-- EN-Revision: 350045 Maintainer: takagi Status: working -->
<!-- Credits: hirokawa,haruki,shimooka,mumumu -->
<!ENTITY installation.enabled.disable 'この拡張モジュールはデフォルトで有効になっています。無効にしたい場合は、次のオプションを指定してコンパイルします。'>
@@ -85,6 +85,9 @@
<!ENTITY note.no-windows.extension '<note xmlns="http://docbook.org/ns/docbook"><simpara>この拡張モジュールは Windows
環境では利用できません。</simpara></note>'>
+<!ENTITY note.no-zts '<note xmlns="http://docbook.org/ns/docbook"><simpara>この関数は
+ZTS (Zend Thread Safety) を有効にしてビルドした PHPインタプリタでは利用できません。あなたの PHP で ZTS が有効かどうかを調べるには、<command>php -i</command> コマンドを使うか、ビルトイン定数<constant>PHP_ZTS</constant> を確認してください。</simpara></note>'>
+
<!ENTITY note.randomseed '<note xmlns="http://docbook.org/ns/docbook"><simpara>
<function>srand</function> または
<function>mt_srand</function>
Modified: phpdoc/ja/trunk/reference/dir/functions/chdir.xml
===================================================================
--- phpdoc/ja/trunk/reference/dir/functions/chdir.xml 2020-06-19 19:38:40 UTC (rev 350054)
+++ phpdoc/ja/trunk/reference/dir/functions/chdir.xml 2020-06-19 19:58:04 UTC (rev 350055)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./ja/functions/dir.xml, last change in rev 1.1 -->
-<!-- EN-Revision: 315520 Maintainer: hirokawa Status: ready -->
-<!-- CREDITS: shimooka -->
+<!-- EN-Revision: 350045 Maintainer: hirokawa Status: ready -->
+<!-- CREDITS: shimooka,mumumu -->
<refentry xml:id="function.chdir" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>chdir</refname>
@@ -85,6 +85,16 @@
<refsect1 role="notes">
&reftitle.notes;
¬e.sm.uidcheck.dir;
+ <caution>
+ <para>
+ PHP インタプリタが ZTS (Zend Thread Safety) を有効にしてビルドされている場合、
+ <function>chdir</function> 関数を使って行った現在のディレクトリの変更はオペレーティングシステムには見えません。
+ 全てのPHPのビルトイン関数は、現在のディレクトリの変更を尊重しますが、
+ <link linkend="book.ffi">FFI</link> を使って呼び出された外部ライブラリはそうではありません。
+ あなたの PHP で ZTS が有効かどうかを調べるには、<command>php -i</command> コマンドを使うか、
+ ビルトイン定数<constant>PHP_ZTS</constant> を確認してください。
+ </para>
+ </caution>
</refsect1>
<refsect1 role="seealso">
Modified: phpdoc/ja/trunk/reference/dir/functions/chroot.xml
===================================================================
--- phpdoc/ja/trunk/reference/dir/functions/chroot.xml 2020-06-19 19:38:40 UTC (rev 350054)
+++ phpdoc/ja/trunk/reference/dir/functions/chroot.xml 2020-06-19 19:58:04 UTC (rev 350055)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 308588 Maintainer: hirokawa Status: ready -->
+<!-- EN-Revision: 350045 Maintainer: hirokawa Status: ready -->
+<!-- Credits: mumumu -->
<refentry xml:id="function.chroot" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>chroot</refname>
@@ -71,6 +72,7 @@
<refsect1 role="notes">
&reftitle.notes;
¬e.no-windows;
+ ¬e.no-zts;
</refsect1>
</refentry>
Modified: phpdoc/ja/trunk/reference/dir/functions/getcwd.xml
===================================================================
--- phpdoc/ja/trunk/reference/dir/functions/getcwd.xml 2020-06-19 19:38:40 UTC (rev 350054)
+++ phpdoc/ja/trunk/reference/dir/functions/getcwd.xml 2020-06-19 19:58:04 UTC (rev 350055)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- splitted from ./ja/functions/dir.xml, last change in rev 1.4 -->
-<!-- EN-Revision: 297028 Maintainer: hirokawa Status: ready -->
-<!-- CREDITS: shimooka -->
+<!-- EN-Revision: 350045 Maintainer: hirokawa Status: ready -->
+<!-- CREDITS: shimooka,mumumu -->
<refentry xml:id="function.getcwd" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>getcwd</refname>
@@ -33,6 +33,18 @@
</para>
</refsect1>
+ <refsect1 role="notes">
+ <caution>
+ <para>
+ PHP インタプリタが ZTS (Zend Thread Safety) を有効にしてビルドされていると、
+ <function>getcwd</function> 関数が返した現在のカレントディレクトリは、
+ オペレーティングシステムが返すそれとは異なる可能性があります。
+ この振る舞いは、カレントディレクトリに依存した
+ (<link linkend="book.ffi">FFI</link> を通じて呼び出される) 外部ライブラリが影響を受けます。
+ </para>
+ </caution>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<para>