svn: /phpdoc/ja/trunk/reference/zip/ziparchive/ open.xml

[email protected] (Yoshinari Takaoka)
Newsgroups php.doc.ja
Message-ID <[email protected]>
mumumu                                   Fri, 20 Mar 2020 14:48:42 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=349503

Log:
ZipArchive::open comment  about empty file not valid any more

Changed paths:
    U   phpdoc/ja/trunk/reference/zip/ziparchive/open.xml

Modified: phpdoc/ja/trunk/reference/zip/ziparchive/open.xml
===================================================================
--- phpdoc/ja/trunk/reference/zip/ziparchive/open.xml	2020-03-20 13:45:41 UTC (rev 349502)
+++ phpdoc/ja/trunk/reference/zip/ziparchive/open.xml	2020-03-20 14:48:42 UTC (rev 349503)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 349472 Maintainer: takagi Status: ready -->
-<!-- CREDITS: shimooka -->
+<!-- EN-Revision: 349502 Maintainer: takagi Status: ready -->
+<!-- CREDITS: shimooka,mumumu -->
 <refentry xml:id="ziparchive.open" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  <refnamediv>
   <refname>ZipArchive::open</refname>
@@ -15,8 +15,11 @@
    <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
   </methodsynopsis>
   <para>
-   新しい zip アーカイブを、読み込み/書き込み/変更用にオープンします。
+   新しい、または既に存在する zip アーカイブを 読み込み/書き込み/変更用にオープンします。
   </para>
+  <para>
+   libzip 1.6.0 以降では、空のファイルは有効なアーカイブではなくなりました。
+  </para>
  </refsect1>
  <refsect1 role="parameters">
   &reftitle.parameters;
@@ -196,6 +199,25 @@
 ]]>
      </programlisting>
     </example>
+    <example>
+     <title>一時的なアーカイブの作成</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+$name = tempnam(sys_get_temp_dir(), "FOO");
+$zip = new ZipArchive;
+$res = $zip->open($name, ZipArchive::OVERWRITE); /* 空のファイルに切り詰めても無効です */
+if ($res === TRUE) {
+    $zip->addFile('data.txt', 'entryname.txt');
+    $zip->close();
+    echo '成功';
+} else {
+    echo '失敗';
+}
+?>
+]]>
+     </programlisting>
+    </example>
    </refsect1>
 </refentry>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.