cvs: phpdoc /en/reference/phar/functions Phar-begin.xml Phar-beginWrite.xml Phar-commit.xml Phar-commitWrite.xml Phar-compressAllFilesBZIP2.xml
Phar-compressAllFilesGZ.xml Phar-getStub.xml Phar-uncompressAllFiles.xml PharFileInfo-setCompressedBZIP2.xml PharFileInfo-setCompressedGZ.xml
PharFileInfo-setUncompressed.xml

From: Date: Sun, 28 Jan 2007 20:08:52 +0000
Subject: cvs: phpdoc /en/reference/phar/functions Phar-begin.xml Phar-beginWrite.xml Phar-commit.xml Phar-commitWrite.xml Phar-compressAllFilesBZIP2.xml
Phar-compressAllFilesGZ.xml Phar-getStub.xml Phar-uncompressAllFiles.xml PharFileInfo-setCompressedBZIP2.xml PharFileInfo-setCompressedGZ.xml
PharFileInfo-setUncompressed.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969375073@lists.php.net to get a copy of this message
cellog Sun Jan 28 20:08:52 2007 UTC Added files: /phpdoc/en/reference/phar/functions Phar-begin.xml Phar-commit.xml Phar-compressAllFilesBZIP2.xml Phar-compressAllFilesGZ.xml Phar-uncompressAllFiles.xml Removed files: /phpdoc/en/reference/phar/functions Phar-beginWrite.xml Phar-commitWrite.xml Modified files: /phpdoc/en/reference/phar/functions Phar-getStub.xml PharFileInfo-setCompressedBZIP2.xml PharFileInfo-setCompressedGZ.xml PharFileInfo-setUncompressed.xml Log: update docs to current cvs

http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-getStub.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/phar/functions/Phar-getStub.xml diff -u phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.1 phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.2 --- phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.1 Sun Jan 28 05:31:52 2007 +++ phpdoc/en/reference/phar/functions/Phar-getStub.xml Sun Jan 28 20:08:52 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.Phar-getStub"> <refnamediv> <refname>Phar-&gt;getStub</refname> @@ -81,8 +81,8 @@ &reftitle.seealso; <para> <simplelist> - <member><link linkend="function.Phar-commitWrite"><function>Phar-&gt;commitWrite</function></link></member> - <member><link linkend="function.Phar-beginWrite"><function>Phar-&gt;beginWrite</function></link></member> + <member><link linkend="function.Phar-commit"><function>Phar-&gt;commit</function></link></member> + <member><link linkend="function.Phar-begin"><function>Phar-&gt;begin</function></link></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.1 phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.2 --- phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.1 Sun Jan 28 05:31:52 2007 +++ phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml Sun Jan 28 20:08:52 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.PharFileInfo-setCompressedBZIP2"> <refnamediv> <refname>PharFileInfo-&gt;setCompressedBZIP2</refname> @@ -17,7 +17,7 @@ The <link linkend="ref.bzip2">bzip2</link> extension must be enabled to take advantage of this feature. In addition, if the file is already compressed using gzip compression, the <link linkend="ref.zlib">zlib</link> extension must be enabled in order - to decompress the file As with all functionality that modifies the contents of + to decompress the file. 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> @@ -70,6 +70,7 @@ <member><link linkend="function.PharFileInfo-isCompressed"><function>PharFileInfo-&gt;isCompressed</function></link></member> <member><link linkend="function.PharFileInfo-setCompressedGZ"><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-compressAllFilesBZIP2"><function>Phar-&gt;compressAllFilesBZIP2</function></link></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.1 phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.2 --- phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.1 Sun Jan 28 05:31:52 2007 +++ phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml Sun Jan 28 20:08:52 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.PharFileInfo-setCompressedGZ"> <refnamediv> <refname>PharFileInfo-&gt;setCompressedGZ</refname> @@ -70,6 +70,7 @@ <member><link linkend="function.PharFileInfo-isCompressed"><function>PharFileInfo-&gt;isCompressed</function></link></member> <member><link linkend="function.PharFileInfo-setCompressedBZIP2"><function>PharFileInfo-&gt;isCompressedBZIP2</function></link></member> <member><link linkend="function.PharFileInfo-setUncompressed"><function>PharFileInfo-&gt;isCompressed</function></link></member> + <member><link linkend="function.Phar-compressAllFilesGZ"><function>Phar-&gt;compressAllFilesGZ</function></link></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.1 phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.2 --- phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.1 Sun Jan 28 05:31:52 2007 +++ phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml Sun Jan 28 20:08:52 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.PharFileInfo-setUncompressed"> <refnamediv> <refname>PharFileInfo-&gt;setUncompressed</refname> @@ -70,6 +70,7 @@ <member><link linkend="function.PharFileInfo-isCompressedBZIP2"><function>PharFileInfo-&gt;isCompressedBZIP2</function></link></member> <member><link linkend="function.PharFileInfo-setCompressedGZ"><function>PharFileInfo-&gt;isCompressedGZ</function></link></member> <member><link linkend="function.PharFileInfo-setCompressedBZIP2"><function>PharFileInfo-&gt;isCompressed</function></link></member> + <member><link linkend="function.Phar-uncompressAllFiles"><function>Phar-&gt;uncompressAllFiles</function></link></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-begin.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/phar/functions/Phar-begin.xml +++ phpdoc/en/reference/phar/functions/Phar-begin.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Phar-begin"> <refnamediv> <refname>Phar-&gt;begin</refname> <refpurpose>Begin a Phar modification transaction</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>Phar-&gt;begin</methodname> <void/> </methodsynopsis> <para> Although technically unnecessary, the <function>begin</function> method can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar archive will be recreated with the changes. In this way, the archive will be up-to-date with the activity performed on it. </para> <para> However, this can be unnecessary when simply creating a new Phar archive, when it would make more sense to write the entire archive out at once. Similarly, it is often necessary to make a series of changes and to ensure that they all are possible before making any changes on disk, similar to the relational database concept of transactions. the <function>begin</function>/<function>commit</function> pair of methods is provided for this purpose. </para> <para> Phar transactions are per-archive, a transaction active on the <literal>foo.phar</literal> Phar archive does not affect changes to the <literal>bar.phar</literal> Phar archive. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>A <function>Phar-&gt;begin</function> example</title> <para> </para> <programlisting role="php"> <![CDATA[ <?php // make sure it doesn't exist @unlink('brandnewphar.phar'); try { $p = new Phar('brandnewphar.phar'); } catch (Exception $e) { echo 'Could not create phar:', $e; } echo 'The new phar has ' . $p->count() . " entries\n"; $p->begin(); $p['file.txt'] = 'hi'; $p['file2.txt'] = 'there'; $p['file2.txt']->setCompressedGZ(); $p['file3.txt'] = 'babyface'; $p['file3.txt']->setMetaData(42); $p->commit("<?php function __autoload($class) { include 'phar://' . str_replace('_', '/', $class); } Phar::mapPhar('myphar.phar'); include 'phar://myphar.phar/startup.php'; __HALT_COMPILER(); ?>"); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="function.Phar-commit"><function>Phar-&gt;commit</function></link></member> <member><link linkend="function.Phar-getStub"><function>Phar-&gt;getStub</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-commit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/phar/functions/Phar-commit.xml +++ phpdoc/en/reference/phar/functions/Phar-commit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Phar-commit"> <refnamediv> <refname>Phar-&gt;commit</refname> <refpurpose>End a Phar modification transaction by writing the Phar archive to disk</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>Phar-&gt;commit</methodname> <void/> </methodsynopsis> <para> Although technically unnecessary, the <function>begin</function> method can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar archive will be recreated with the changes. In this way, the archive will be up-to-date with the activity performed on it. </para> <para> However, this can be unnecessary when simply creating a new Phar archive, when it would make more sense to write the entire archive out at once. Similarly, it is often necessary to make a series of changes and to ensure that they all are possible before making any changes on disk, similar to the relational database concept of transactions. the <function>begin</function>/<function>commit</function> pair of methods is provided for this purpose. </para> <para> Phar transactions are per-archive, a transaction active on the <literal>foo.phar</literal> Phar archive does not affect changes to the <literal>bar.phar</literal> Phar archive. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>A <function>Phar-&gt;commit</function> example</title> <para> </para> <programlisting role="php"> <![CDATA[ <?php $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar'); $p['file1.txt'] = 'hi'; $p->commit(); var_dump($p->getStub()); $p->commit("<?php function __autoload(\$class) { include 'phar://' . str_replace('_', '/', \$class); } Phar::mapPhar('brandnewphar.phar'); include 'phar://brandnewphar.phar/startup.php'; __HALT_COMPILER(); ?>"); var_dump($p->getStub()); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ string(24) "<?php __HALT_COMPILER();" string(198) "<?php function __autoload($class) { include 'phar://' . str_replace('_', '/', $class); } Phar::mapPhar('brandnewphar.phar'); include 'phar://brandnewphar.phar/startup.php'; __HALT_COMPILER(); ?>" ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="function.Phar-begin"><function>Phar-&gt;begin</function></link></member> <member><link linkend="function.Phar-getStub"><function>Phar-&gt;getStub</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml +++ phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Phar-compressAllFilesBZIP2"> <refnamediv> <refname>PharFileInfo-&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 causes all files in the Phar archive to be compressed 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 file. 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('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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml +++ phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Phar-compressAllFilesGZ"> <refnamediv> <refname>PharFileInfo-&gt;compressAllFilesGZ</refname> <refpurpose>Compresses all files in the current Phar archive using Gzip compression</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>Phar-&gt;compressAllFilesGZ</methodname> <void/> </methodsynopsis> <para> This method causes all files in the Phar archive to be compressed using gzip compression. The <link linkend="ref.zlib">zlib</link> extension must be enabled to take advantage of this feature. In addition, if any files are already compressed using bzip2 compression, the <link linkend="ref.bzip2">bzip2</link> extension must be enabled in order to decompress the file. 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.zlib">zlib</link> extension is not available, or if any files are compressed using bzip2 compression and the <link linkend="ref.bzip2">bzip2</link> extension is not enabled. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>A <function>Phar-&gt;compressAllFilesGZ</function> example</title> <programlisting role="php"> <![CDATA[ <?php $p = new Phar('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->compressAllFilesGZ(); 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(false) bool(true) string(11) "myfile2.txt" bool(true) bool(false) bool(true) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="function.PharFileInfo-getCompressedSize"><function>PharFileInfo-&gt;getCompressedSize</function></link></member> <member><link linkend="function.PharFileInfo-isCompressedGZ"><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-setCompressedGZ"><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-compressAllFilesBZIP2"><function>Phar-&gt;compressAllFilesBZIP2</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml +++ phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Phar-uncompressAllFiles"> <refnamediv> <refname>PharFileInfo-&gt;uncompressAllFiles</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;uncompressAllFiles</methodname> <void/> </methodsynopsis> <para> This method causes all files in the Phar archive to be uncompressed. 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 file, and any files compressed using bzip2 compression require the <link linkend="ref.bzip2">bzip2</link> extension to decompress the file. 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 enabled and any files are compressed using bzip2 compression, 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;uncompressAllFiles</function> example</title> <programlisting role="php"> <![CDATA[ <?php $p = new Phar('my.phar'); $p['myfile.txt'] = 'hi'; $p['myfile2.txt'] = 'hi'; $p->compressAllFilesGZ(); foreach ($p as $file) { var_dump($file->getFileName()); var_dump($file->isCompressed()); var_dump($file->isCompressedBZIP2()); var_dump($file->isCompressedGZ()); } $p->uncompressAllFiles(); 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(true) bool(false) bool(true) string(11) "myfile2.txt" bool(true) bool(false) bool(true) string(10) "myfile.txt" bool(false) bool(false) bool(false) string(11) "myfile2.txt" bool(false) bool(false) 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-compressAllFilesBZIP2"><function>Phar-&gt;compressAllFilesBZIP2</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 -->
« previous php.doc (#969375073) next »