update docs to current cvs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228329 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Greg Beaver 2007-01-28 20:08:52 +00:00
parent 197fd97add
commit a69f689899
9 changed files with 408 additions and 26 deletions

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-beginWrite">
<refentry id="function.Phar-begin">
<refnamediv>
<refname>Phar-&gt;beginWrite</refname>
<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;beginWrite</methodname>
<type>void</type><methodname>Phar-&gt;begin</methodname>
<void/>
</methodsynopsis>
<para>
Although technically unnecessary, the <function>beginWrite</function> method
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
@ -26,7 +26,7 @@
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>beginWrite</function>/<function>commitWrite</function> pair
<function>begin</function>/<function>commit</function> pair
of methods is provided for this purpose.
</para>
<para>
@ -41,7 +41,7 @@
&reftitle.examples;
<para>
<example>
<title>A <function>Phar-&gt;beginWrite</function> example</title>
<title>A <function>Phar-&gt;begin</function> example</title>
<para>
</para>
<programlisting role="php">
@ -55,13 +55,13 @@ try {
echo 'Could not create phar:', $e;
}
echo 'The new phar has ' . $p->count() . " entries\n";
$p->beginWrite();
$p->begin();
$p['file.txt'] = 'hi';
$p['file2.txt'] = 'there';
$p['file2.txt']->setCompressedGZ();
$p['file3.txt'] = 'babyface';
$p['file3.txt']->setMetaData(42);
$p->commitWrite("<?php
$p->commit("<?php
function __autoload($class)
{
include 'phar://' . str_replace('_', '/', $class);
@ -81,7 +81,7 @@ __HALT_COMPILER();
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="function.Phar-commitWrite"><function>Phar-&gt;commitWrite</function></link></member>
<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>

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<refentry id="function.Phar-commitWrite">
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-commit">
<refnamediv>
<refname>Phar-&gt;commitWrite</refname>
<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;commitWrite</methodname>
<type>void</type><methodname>Phar-&gt;commit</methodname>
<void/>
</methodsynopsis>
<para>
Although technically unnecessary, the <function>beginWrite</function> method
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
@ -26,7 +26,7 @@
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>beginWrite</function>/<function>commitWrite</function> pair
<function>begin</function>/<function>commit</function> pair
of methods is provided for this purpose.
</para>
<para>
@ -41,7 +41,7 @@
&reftitle.examples;
<para>
<example>
<title>A <function>Phar-&gt;commitWrite</function> example</title>
<title>A <function>Phar-&gt;commit</function> example</title>
<para>
</para>
<programlisting role="php">
@ -49,9 +49,9 @@
<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p['file1.txt'] = 'hi';
$p->commitWrite();
$p->commit();
var_dump($p->getStub());
$p->commitWrite("<?php
$p->commit("<?php
function __autoload(\$class)
{
include 'phar://' . str_replace('_', '/', \$class);
@ -87,7 +87,7 @@ __HALT_COMPILER();
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="function.Phar-beginWrite"><function>Phar-&gt;beginWrite</function></link></member>
<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>

View file

@ -0,0 +1,125 @@
<?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
-->

View file

@ -0,0 +1,126 @@
<?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
-->

View file

@ -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 @@ __HALT_COMPILER();
&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>

View file

@ -0,0 +1,128 @@
<?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
-->

View file

@ -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 @@ bool(true)
<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>

View file

@ -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 @@ bool(true)
<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>

View file

@ -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 @@ bool(false)
<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>