cvs: peardoc /en/packages/file archive-tar.xml
| From: | Vincent Blavet | Date: | Sat, 26 Jan 2002 00:16:48 +0000 |
| Subject: | cvs: peardoc /en/packages/file archive-tar.xml | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2129@lists.php.net to get a copy of this message | ||
vblavet Fri Jan 25 19:16:48 2002 EDT
Modified files:
/peardoc/en/packages/file archive-tar.xml
Log:
Updating documentation
Index: peardoc/en/packages/file/archive-tar.xml
diff -u peardoc/en/packages/file/archive-tar.xml:1.1 peardoc/en/packages/file/archive-tar.xml:1.2
--- peardoc/en/packages/file/archive-tar.xml:1.1 Fri Jan 25 11:46:23 2002
+++ peardoc/en/packages/file/archive-tar.xml Fri Jan 25 19:16:48 2002
@@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
-<!-- $Id: archive-tar.xml,v 1.1 2002/01/25 16:46:23 mj Exp $ -->
+<!-- $Id: archive-tar.xml,v 1.2 2002/01/26 00:16:48 vblavet Exp $ -->
<refentry id="packages.file.archive-tar">
<refnamediv>
<refname>Archive_Tar</refname>
@@ -46,10 +46,17 @@
</funcprototype>
</funcsynopsis>
<para>
- This method creates the archive file and add the listed files or
- directories. If the file already exists and is writable, it is replaced by
- the new tar. It is a create and not an add. If the file exists and is
- read-only or is a directory it is not replaced.
+ This method creates the archive file and add the listed files or
+ directories.
+ If a file with the same name exist and is writable, it is replaced
+ by the new tar.
+ The method return false and a PEAR error text.
+ The list can be an array of string, each string
+ representing a filename or a directory name with their path if
+ needed. It can also be a single string with names separated by a
+ single blank.
+ For each directory added in the archive, the files and
+ sub-directories are also added.
</para>
<para>
Parameter
@@ -68,7 +75,7 @@
<listitem>
<para>
<parameter>boolean</parameter> - <parameter>true</parameter> on
- success,<parameter>false</parameter> on error
+ success, <parameter>false</parameter> on error
</para>
</listitem>
</itemizedlist>
@@ -84,7 +91,11 @@
</funcprototype>
</funcsynopsis>
<para>
- Adds files to the archive
+ This method add the files / directories that are listed in $p_filelist in
+ the archive. If the archive does not exist it is created.
+ The files and directories listed are only added at the end of the archive,
+ even if a file with the same name is already archived.
+ The method return false and a PEAR error text.
</para>
<para>
Parameter
@@ -103,7 +114,7 @@
<listitem>
<para>
<parameter>boolean</parameter> - <parameter>true</parameter> on
- success,<parameter>false</parameter> on error
+ success, <parameter>false</parameter> on error
</para>
</listitem>
</itemizedlist>
@@ -119,7 +130,7 @@
</funcprototype>
</funcsynopsis>
<para>
- Extracts the files to the archive into the given path
+ Extracts the files to the archive into the given path.
</para>
<para>
Parameter
@@ -193,6 +204,18 @@
ignored.
</para>
<para>
+ The path indicated in <parameter>$remove_dir</parameter> will be removed from
+ the memorized path of each file / directory listed when this path
+ exists. By default nothing is removed (empty path '')
+ The path indicated in <parameter>$add_dir</parameter> will be added at the
+ beginning of
+ the memorized path of each file / directory listed. However it can
+ be set to empty ''. The adding of a path is done after the removing
+ of path.
+ The path add/remove ability enables the user to prepare an archive
+ for extraction in a different path than the origin files are.
+ </para>
+ <para>
Parameter
<itemizedlist>
<listitem>
@@ -223,6 +246,16 @@
</listitem>
</itemizedlist>
</para>
+ <example>
+ <title>addModify()</title>
+ <programlisting role="php">
+ <![CDATA[
+ $tar = new Archive_Tar('archive.tgz', true);
+ $result = $tar->addModify('data/file.txt', 'user', 'data');
+ // File will be added in the archive like : 'user/file.txt'
+ ]]>
+ </programlisting>
+ </example>
</refsect1>
<refsect1 id="packages.file.archive-tar.createmodify">