<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="pharfileinfo.iscompressed" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>PharFileInfo::isCompressed</refname>
  <refpurpose>Returns whether the entry is compressed</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="PharFileInfo">
   <modifier>public</modifier> <type>bool</type><methodname>PharFileInfo::isCompressed</methodname>
   <methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>compression</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>

  <para>
   This returns whether a file is compressed within a Phar archive
   with either Gzip or Bzip2 compression.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>compression</parameter></term>
     <listitem>
      <para>
       One of <constant>Phar::GZ</constant> or <constant>Phar::BZ2</constant>,
       defaults to any compression.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &true; if the file is compressed within the Phar archive, &false; if not.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>8.0.0</entry>
      <entry>
       <parameter>compression</parameter> is now nullable.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>A <function>PharFileInfo::isCompressed</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
try {
    $p = new Phar('/path/to/my.phar', 0, 'my.phar');
    $p['myfile.txt'] = 'hi';
    $p['myfile2.txt'] = 'hi';
    $p['myfile2.txt']->setCompressedGZ();
    $file = $p['myfile.txt'];
    $file2 = $p['myfile2.txt'];
    var_dump($file->isCompressed());
    var_dump($file2->isCompressed());
} catch (Exception $e) {
    echo 'Create/modify on phar my.phar failed: ', $e;
}
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
<![CDATA[
bool(false)
bool(true)
]]>
    </screen>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>PharFileInfo::getCompressedSize</function></member>
    <member><function>PharFileInfo::decompress</function></member>
    <member><function>PharFileInfo::compress</function></member>
    <member><function>Phar::decompress</function></member>
    <member><function>Phar::compress</function></member>
    <member><function>Phar::canCompress</function></member>
    <member><function>Phar::isCompressed</function></member>
    <member><function>Phar::getSupportedCompression</function></member>
    <member><function>Phar::decompressFiles</function></member>
    <member><function>Phar::compressFiles</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
