cvs: peardoc /en/package/filesystem/archive-tar extractinstring.xml
| From: | Vincent Blavet | Date: | Wed, 25 Jun 2003 21:18:36 +0000 |
| Subject: | cvs: peardoc /en/package/filesystem/archive-tar extractinstring.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1007@lists.php.net to get a copy of this message | ||
vblavet Wed Jun 25 17:18:36 2003 EDT
Added files:
/peardoc/en/package/filesystem/archive-tar extractinstring.xml
Log:
Add documentation for method extractInString()
Index: peardoc/en/package/filesystem/archive-tar/extractinstring.xml
+++ peardoc/en/package/filesystem/archive-tar/extractinstring.xml
<!-- $Revision: 1.1 $ -->
<refentry id="package.filesystem.archive-tar.extractinstring">
<refnamediv>
<refname>Archive_Tar::extractInString()</refname>
<refpurpose>extract one file and return it as a string</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
require_once 'Archive/Tar.php';
</funcsynopsisinfo>
<funcprototype>
<funcdef>boolean <function>extractInString</function></funcdef>
<paramdef>string <parameter>$path</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="package.filesystem.archive-tar.extractinstring.desc">
&title.desc;
<para>
This method extracts the file identified by <parameter>path</parameter>
from the archive and returns it
as a string.
It does not use temporary files.
</para>
</refsect1>
<refsect1 id="package.filesystem.archive-tar.extractinstring.parameter">
&title.param;
<para>
<itemizedlist>
<listitem>
<para>
<parameter>string $path</parameter> - the path of the file
to extract
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 id="package.filesystem.archive-tar.extractinstring.return">
&title.returns;
<para>
<parameter>string</parameter> - the content of the extracted file
</para>
</refsect1>
<refsect1 id="package.filesystem.archive-tar.extractinstring.throws">
&title.throws;
<para>
<table>
<title>&title.throws.errortable;</title>
<tgroup cols="4">
<thead>
<row>
<entry>Error code</entry>
<entry>Error message</entry>
<entry>Reason</entry>
<entry>Solution</entry>
</row>
</thead>
<tbody>
<row>
<entry>null</entry>
<entry>
<quote>
Unable to open in read mode <parameter>archive</parameter>
</quote>
</entry>
<entry>
The file is exclusive locked by another application.
</entry>
<entry>
Check for other applications working on the file.
This can not be caused by a competive processing the archive
with <classname>Archive_Tar</classname>
</entry>
</row>
<row>
<entry>null</entry>
<entry>
<quote>
Invalid extractinstring mode <parameter>mode</parameter>
</quote>
</entry>
<entry>
Implementation error
</entry>
<entry>
Should not occur, please set up a bug report.
</entry>
</row>
<row>
<entry>null</entry>
<entry>
<quote>
Error while opening <parameter>name</parameter> in write binary mode
</quote>
</entry>
<entry>
The file could not be created.
</entry>
<entry>
The file is maybe locked.
</entry>
</row>
<row>
<entry>null</entry>
<entry>
<quote>
Extracted file <parameter>filename</parameter> does
not have the correct file size <parameter>filesize</parameter>
(<parameter>size</parameter> expected). Archive may be corrupted.
</quote>
</entry>
<entry>
Read the message.
</entry>
<entry>
Read the message.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
<refsect1 id="package.filesystem.archive-tar.extractinstring.note">
&title.note;
¬e.notstatic;
</refsect1>
<refsect1 id="package.filesystem.archive-tar.extractinstring.example">
&title.example;
<example>
<title>
Extract a file in a string
</title>
<programlisting>
<![CDATA[
// tarname.tar with files :
// dev/data/file.txt
// dev/data/log.txt
// dev/readme.txt
$tar_object = new Archive_Tar("tarname.tar");
$text = $tar_object->extractInString("dev/readme.txt");
echo $text;
]]>
</programlisting>
</example>
</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
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
-->