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

[email protected] (Yoshinari Takaoka)
Newsgroups php.doc.ja
Message-ID <[email protected]>
mumumu                                   Thu, 19 Mar 2020 00:57:59 +0000

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

Log:
add another ex from #79157

Bug: https://bugs.php.net/79157 (Closed) Documentation unclear for ZipArchive::setCompressionName
      
Changed paths:
    U   phpdoc/ja/trunk/reference/zip/ziparchive/setcompressionname.xml

Modified: phpdoc/ja/trunk/reference/zip/ziparchive/setcompressionname.xml
===================================================================
--- phpdoc/ja/trunk/reference/zip/ziparchive/setcompressionname.xml	2020-03-18 19:13:03 UTC (rev 349490)
+++ phpdoc/ja/trunk/reference/zip/ziparchive/setcompressionname.xml	2020-03-19 00:57:59 UTC (rev 349491)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 337775 Maintainer: mumumu Status: ready -->
+<!-- EN-Revision: 349489 Maintainer: mumumu Status: ready -->
 <refentry xml:id="ziparchive.setcompressionname" xmlns="http://docbook.org/ns/docbook">
  <refnamediv>
   <refname>ZipArchive::setCompressionName</refname>
@@ -34,10 +34,8 @@
      <term><parameter>comp_method</parameter></term>
      <listitem>
       <para>
-       圧縮メソッド。以下のいずれかです。
-       <constant>ZipArchive::CM_DEFAULT</constant>,
-       <constant>ZipArchive::CM_STORE</constant>,
-       <constant>ZipArchive::CM_DEFLATE</constant>.
+       圧縮メソッド。
+       <constant>ZipArchive::CM_*</constant> のいずれかです。
       </para>
      </listitem>
     </varlistentry>
@@ -45,7 +43,7 @@
      <term><parameter>comp_flags</parameter></term>
      <listitem>
       <para>
-       圧縮フラグ。現在は使われていません。
+       圧縮レベル
       </para>
      </listitem>
     </varlistentry>
@@ -81,6 +79,25 @@
 ]]>
      </programlisting>
     </example>
+    <example>
+     <title>ファイルを追加し、圧縮メソッドを設定する</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+$zip = new ZipArchive;
+$res = $zip->open('test.zip', ZipArchive::CREATE);
+if ($res === TRUE) {
+    $zip->addFile('foo.jpg', 'bar.jpg');
+    $zip->setCompressionName('bar.jpg', ZipArchive::CM_XZ);
+    $zip->close();
+    echo 'ok';
+} else {
+    echo 'failed';
+}
+?>
+]]>
+     </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.