php-doc-en/reference/phar/functions/phar-compressallfilesbzip2.xml
Hannes Magnusson c030e2adf7 Upgrade to DocBook5:
- All id attributes are now xml:id
 - Add docbook namespace to all root elements
 - Replace <ulink /> with <link xlink:href />
 - Minor markup fixes here and there


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-20 22:25:43 +00:00

126 lines
3.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.phar-compressallfilesbzip2">
<refnamediv>
<refname>Phar-&gt;compressAllFilesBZIP2</refname>
<refpurpose>Compresses all files in the current Phar archive using Bzip2 compression</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>Phar-&gt;compressAllFilesBZIP2</methodname>
<void/>
</methodsynopsis>
<para>
This method compresses all files in the Phar archive using bzip2 compression.
The <link linkend="ref.bzip2">bzip2</link> extension must be enabled to take
advantage of this feature. In addition, if any files are already compressed using
gzip compression, the <link linkend="ref.zlib">zlib</link> extension must be enabled in order
to decompress the files prior to re-compressing with bzip2 compression.
As with all functionality that modifies the contents of
a phar, the <link linkend="ini.phar.readonly">phar.readonly</link> INI variable
must be off in order to succeed.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws <classname>BadMethodCallException</classname> if
the <link linkend="ini.phar.readonly">phar.readonly</link>
INI variable is on, the <link linkend="ref.bzip2">bzip2</link>
extension is not available, or if any files are compressed using
gzip compression and the <link linkend="ref.zlib">zlib</link> extension
is not enabled.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar-&gt;compressAllFilesBZIP2</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
foreach ($p as $file) {
var_dump($file->getFileName());
var_dump($file->isCompressed());
var_dump($file->isCompressedBZIP2());
var_dump($file->isCompressedGZ());
}
$p->compressAllFilesBZIP2();
foreach ($p as $file) {
var_dump($file->getFileName());
var_dump($file->isCompressed());
var_dump($file->isCompressedBZIP2());
var_dump($file->isCompressedGZ());
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(10) "myfile.txt"
bool(false)
bool(false)
bool(false)
string(11) "myfile2.txt"
bool(false)
bool(false)
bool(false)
string(10) "myfile.txt"
bool(true)
bool(true)
bool(false)
string(11) "myfile2.txt"
bool(true)
bool(true)
bool(false)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="function.pharfileinfo-iscompressedbzip2"><function>PharFileInfo-&gt;isCompressedGZ</function></link></member>
<member><link linkend="function.pharfileinfo-iscompressed"><function>PharFileInfo-&gt;isCompressed</function></link></member>
<member><link linkend="function.pharfileinfo-setcompressedbzip2"><function>PharFileInfo-&gt;isCompressedGZ</function></link></member>
<member><link linkend="function.pharfileinfo-setuncompressed"><function>PharFileInfo-&gt;isCompressed</function></link></member>
<member><link linkend="function.phar-uncompressallfiles"><function>Phar-&gt;uncompressAllFiles</function></link></member>
<member><link linkend="function.phar-compressallfilesgz"><function>Phar-&gt;compressAllFilesGZ</function></link></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:"../../../../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
-->