cvs: peardoc /en/package/fileformats/file-archive examples.xml predicates.xml readers.xml
| From: | Christophe Gesché | Date: | Mon, 07 Jul 2008 04:27:57 +0000 |
| Subject: | cvs: peardoc /en/package/fileformats/file-archive examples.xml predicates.xml readers.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-10964@lists.php.net to get a copy of this message | ||
moosh Mon Jul 7 04:27:57 2008 UTC
Modified files:
/peardoc/en/package/fileformats/file-archive examples.xml
predicates.xml
readers.xml
Log:
No change in the content. only reformat source
http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/examples.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/examples.xml diff -u peardoc/en/package/fileformats/file-archive/examples.xml:1.1 peardoc/en/package/fileformats/file-archive/examples.xml:1.2 --- peardoc/en/package/fileformats/file-archive/examples.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/examples.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: examples.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: examples.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.examples"> <refnamediv> <refname>Examples</refname> @@ -11,8 +11,9 @@ <refsect1 id="package.fileformats.file-archive.examples.extractarchive"> <title>Extract a tar archive to a sub directory</title> <para> - Here we simply take a tar archive called <filename>archive.tar</filename> - and extract its contents to the folder <filename>output/</filename>. + Here we simply take a tar archive called + <filename>archive.tar</filename> + and extract its contents to the folder </para> <programlisting role="php"><![CDATA[ <?php @@ -48,8 +49,9 @@ <title>Extracting a file from an archive</title> <para> Use <function>extract</function> to get files out of an archive. - When specifying the file to extract, make sure to use the archive name - as first folder. + + When specifying the file to extract, + make sure to use the archive name as first folder. </para> <programlisting role="php"><![CDATA[ <?php http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/predicates.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/predicates.xml diff -u peardoc/en/package/fileformats/file-archive/predicates.xml:1.1 peardoc/en/package/fileformats/file-archive/predicates.xml:1.2 --- peardoc/en/package/fileformats/file-archive/predicates.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/predicates.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: predicates.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: predicates.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.predicates"> <refnamediv> <refname>Predicates</refname> @@ -62,22 +62,26 @@ <itemizedlist> <listitem> <para> - <command>predMinSize($size)</command>: keep only the files which size is + <command>predMinSize($size)</command>: + keep only the files + which size is <literal>>= $size</literal> (in bytes). </para> </listitem> <listitem> <para> - <command>predMinTime($time)</command>: keep only the files that have - been modified after $time (unix timestamp). + <command>predMinTime($time)</command>: + keep only the files that + have been modified after $time (unix timestamp). </para> </listitem> <listitem> <para> - <command>predMaxDepth($depth)</command>: keep only the files that have a - public name with less than <varname>$depth</varname> directories. + <command>predMaxDepth($depth)</command>: + keep only the files that + have a public name with less than <varname>$depth</varname> directories. </para> </listitem> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/readers.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/readers.xml diff -u peardoc/en/package/fileformats/file-archive/readers.xml:1.1 peardoc/en/package/fileformats/file-archive/readers.xml:1.2 --- peardoc/en/package/fileformats/file-archive/readers.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/readers.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: readers.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: readers.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.readers"> <refnamediv> <refname>Readers</refname> @@ -12,14 +12,19 @@ <title>Introduction</title> <para> A reader is an object that represents a list of files and directories. + Those files can be generated dynamically or exist physically. + For example, there is a reader class for a directory, - or for each archive format handled by <classname>File_Archive</classname>, + or for each archive format handled by + <classname>File_Archive</classname>, and they all have the same interface. </para> <para> - To create a reader, you will have to use the + To create a reader, + you will have to use the <classname>File_Archive</classname> factory. + The important function is the <function>read</function> function: </para> <funcsynopsis> @@ -88,23 +93,43 @@ <para> The <literal>symbolic</literal> attribute says how the files read will be displayed for future use. - If <varname>$URL</varname> is a directory, <varname>$URL</varname> will - be replaced by <varname>$symbolic</varname> (or <literal>''</literal> if - <varname>$symbolic</varname> is <literal>null</literal>). - So, in our first example, the files will be displayed as if the current - directory was <literal>'Path/to/dir'</literal>: + If <varname>$URL</varname> is a directory, + <varname>$URL</varname> + will be replaced by + <varname>$symbolic</varname> + (or + <literal>''</literal> + if + <varname>$symbolic</varname> + is + <literal>null</literal>). + + So, + in our first example, + the files will be displayed as if the current directory was + <literal>'Path/to/dir'</literal>: + Since by default <varname>$symbolic</varname> is empty, - <literal>Path/to/dir</literal> will be simply removed from the file. + <literal>Path/to/dir</literal> + will be simply removed from the file. + You may want to put <literal>Path/to/dir</literal> as <varname>$symbolic</varname> to keep the full path <literal>Path/to/dir</literal>. </para> <para> - If <varname>$URL</varname> is a file, then only the filename will be kept, - and <varname>$symbolic</varname> will be added to it. - So, in our second example, the source contains a file with symbolic name + If <varname>$URL</varname> is a file, + then only the filename will be kept, + and + <varname>$symbolic</varname> + will be added to it. + + So, + in our second example, + the source contains a file with symbolic name <literal>file.txt</literal>. + If a symbolic name <literal>foo</literal> had been specified, the source would contain <literal>foo/file.txt</literal>. </para> @@ -112,17 +137,22 @@ <para> The <varname>$uncompression</varname> parameter indicate how many files will be uncompressed while parsing the tree to files. + By default the files are not uncompressed. + So, if you do - <command>File_Archive::read('archive.tar/inner/dir', 'inner/dir')</command>, - and if <filename>archive.tar</filename> contains a file called - <filename>archive.tar/inner/dir/file.tgz</filename>, this second archive - will appear as a file and not as a directory. - It won't be uncompressed because <varname>$uncompression</varname> is - <literal>0</literal>. + <command>File_Archive::read('archive.tar/inner/dir', 'inner/dir')</command>, + and if <filename>archive.tar</filename> contains a file called + <filename>archive.tar/inner/dir/file.tgz</filename>, this second archive + will appear as a file and not as a directory. + + It won't be uncompressed because <varname>$uncompression</varname> + is <literal>0</literal>. + If <varname>$uncompression</varname> is set to <literal>1</literal>, - <filename>file.tgz</filename> would appear as a directory, - but the files inside this archive would not be uncompressed. + <filename>file.tgz</filename> would appear as a directory, + but the files inside this archive would not be uncompressed. + If <varname>$uncompression</varname> is set to <literal>-1</literal>, all the files would be uncompressed, regardless of the depth. </para> @@ -135,8 +165,9 @@ </note> <para> - The <varname>$directoryDepth</varname> parameter gives a limit to the - number of directory read by the reader. + The <varname>$directoryDepth</varname> parameter + gives a limit to the number of directory + read by the reader. </para> </refsect1> @@ -146,7 +177,9 @@ <title>Multi readers</title> <para> - Using a multi reader, you can make several sources appear as one. + Using a multi reader, + you can make several sources appear as one. + You can create a multi reader using the <command>File_Archive::readMulti()</command> function. </para> @@ -177,7 +210,9 @@ <listitem> <para><command>function next()</command></para> <para> - Go to the next file in the source. Returns <literal>false</literal> + Go to the next file in the source. + + Returns <literal>false</literal> when the end of the archive is reached. </para> </listitem> @@ -185,15 +220,19 @@ <listitem> <para><command>function getFilename()</command></para> <para> - Returns the filename of the currently selected entry in the archive. + Returns the filename + of the currently selected entry + in the archive. </para> </listitem> <listitem> <para><command>function getStat()</command></para> <para> - Returns the stat as the <function>stat</function> function does - This function may not return a complete array, it may even return + Returns the stat as the <function>stat</function> function does. + + This function may not return a complete array, + it may even return <literal>array()</literal>. </para> </listitem> @@ -201,9 +240,11 @@ <listitem> <para><command>function getDataFilename()</command></para> <para> - For optimisation purposes: if the source is a physical file, - this function returns the name of the file; otherwise - it returns <literal>null</literal>. + For optimisation purposes: + if the source is a physical file, + this function returns the name of the file; + otherwise it returns + <literal>null</literal>. </para> </listitem> @@ -211,6 +252,7 @@ <para><command>function getData($length = -1)</command></para> <para> Reads some data from the source. + This function will return a string which size is determined by the smallest of <itemizedlist> @@ -226,7 +268,8 @@ </para> </listitem> </itemizedlist> - If the end of the file is reached, the function will return + If the end of the file is reached, + the function will return <literal>null</literal>. </para> </listitem> @@ -234,9 +277,11 @@ <listitem> <para><command>function skip($length)</command></para> <para> - Equivalent to <command>getData($length)</command>, but does not return - any data. - Depending on the data reader, this function can be far more efficient + Equivalent to <command>getData($length)</command>, + but does not return any data. + + Depending on the data reader, + this function can be far more efficient than <function>getData</function>. </para> </listitem> @@ -245,10 +290,14 @@ <para><command>function close()</command></para> <para> Should be called after having used the data reader - (closes the file handles...). - This function moves the object in the same state as it was before the - first call to <function>next</function>. - After this call, you can iterate again on the data reader. + (closes the file handles...). + + This function moves the object in the same state + as it was before the first call to + <function>next</function>. + + After this call, + you can iterate again on the data reader. </para> </listitem> </itemizedlist> @@ -272,14 +321,18 @@ <title>Functions that use readers</title> <para> - All <classname>File_Archive</classname> functions that take a reader as an - argument also accept strings and arrays. + All <classname>File_Archive</classname> + functions that take a reader as an + argument also accept strings and arrays. + The strings will be automatically interpreted as a reader using <command>File_Archive::read</command> function. + The arrays will be interpreted as a multi reader. </para> <para> - Since the readers are passed by reference, you will have to pass a variable + Since the readers are passed by reference, + you will have to pass a variable and not the raw string or array. </para> <para>
http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/examples.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/examples.xml diff -u peardoc/en/package/fileformats/file-archive/examples.xml:1.1 peardoc/en/package/fileformats/file-archive/examples.xml:1.2 --- peardoc/en/package/fileformats/file-archive/examples.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/examples.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: examples.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: examples.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.examples"> <refnamediv> <refname>Examples</refname> @@ -11,8 +11,9 @@ <refsect1 id="package.fileformats.file-archive.examples.extractarchive"> <title>Extract a tar archive to a sub directory</title> <para> - Here we simply take a tar archive called <filename>archive.tar</filename> - and extract its contents to the folder <filename>output/</filename>. + Here we simply take a tar archive called + <filename>archive.tar</filename> + and extract its contents to the folder </para> <programlisting role="php"><![CDATA[ <?php @@ -48,8 +49,9 @@ <title>Extracting a file from an archive</title> <para> Use <function>extract</function> to get files out of an archive. - When specifying the file to extract, make sure to use the archive name - as first folder. + + When specifying the file to extract, + make sure to use the archive name as first folder. </para> <programlisting role="php"><![CDATA[ <?php http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/predicates.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/predicates.xml diff -u peardoc/en/package/fileformats/file-archive/predicates.xml:1.1 peardoc/en/package/fileformats/file-archive/predicates.xml:1.2 --- peardoc/en/package/fileformats/file-archive/predicates.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/predicates.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: predicates.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: predicates.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.predicates"> <refnamediv> <refname>Predicates</refname> @@ -62,22 +62,26 @@ <itemizedlist> <listitem> <para> - <command>predMinSize($size)</command>: keep only the files which size is + <command>predMinSize($size)</command>: + keep only the files + which size is <literal>>= $size</literal> (in bytes). </para> </listitem> <listitem> <para> - <command>predMinTime($time)</command>: keep only the files that have - been modified after $time (unix timestamp). + <command>predMinTime($time)</command>: + keep only the files that + have been modified after $time (unix timestamp). </para> </listitem> <listitem> <para> - <command>predMaxDepth($depth)</command>: keep only the files that have a - public name with less than <varname>$depth</varname> directories. + <command>predMaxDepth($depth)</command>: + keep only the files that + have a public name with less than <varname>$depth</varname> directories. </para> </listitem> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-archive/readers.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-archive/readers.xml diff -u peardoc/en/package/fileformats/file-archive/readers.xml:1.1 peardoc/en/package/fileformats/file-archive/readers.xml:1.2 --- peardoc/en/package/fileformats/file-archive/readers.xml:1.1 Sun Feb 17 09:52:06 2008 +++ peardoc/en/package/fileformats/file-archive/readers.xml Mon Jul 7 04:27:57 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- $Id: readers.xml,v 1.1 2008/02/17 09:52:06 cweiske Exp $ --> +<!-- $Revision: 1.2 $ --> +<!-- $Id: readers.xml,v 1.2 2008/07/07 04:27:57 moosh Exp $ --> <refentry id="package.fileformats.file-archive.readers"> <refnamediv> <refname>Readers</refname> @@ -12,14 +12,19 @@ <title>Introduction</title> <para> A reader is an object that represents a list of files and directories. + Those files can be generated dynamically or exist physically. + For example, there is a reader class for a directory, - or for each archive format handled by <classname>File_Archive</classname>, + or for each archive format handled by + <classname>File_Archive</classname>, and they all have the same interface. </para> <para> - To create a reader, you will have to use the + To create a reader, + you will have to use the <classname>File_Archive</classname> factory. + The important function is the <function>read</function> function: </para> <funcsynopsis> @@ -88,23 +93,43 @@ <para> The <literal>symbolic</literal> attribute says how the files read will be displayed for future use. - If <varname>$URL</varname> is a directory, <varname>$URL</varname> will - be replaced by <varname>$symbolic</varname> (or <literal>''</literal> if - <varname>$symbolic</varname> is <literal>null</literal>). - So, in our first example, the files will be displayed as if the current - directory was <literal>'Path/to/dir'</literal>: + If <varname>$URL</varname> is a directory, + <varname>$URL</varname> + will be replaced by + <varname>$symbolic</varname> + (or + <literal>''</literal> + if + <varname>$symbolic</varname> + is + <literal>null</literal>). + + So, + in our first example, + the files will be displayed as if the current directory was + <literal>'Path/to/dir'</literal>: + Since by default <varname>$symbolic</varname> is empty, - <literal>Path/to/dir</literal> will be simply removed from the file. + <literal>Path/to/dir</literal> + will be simply removed from the file. + You may want to put <literal>Path/to/dir</literal> as <varname>$symbolic</varname> to keep the full path <literal>Path/to/dir</literal>. </para> <para> - If <varname>$URL</varname> is a file, then only the filename will be kept, - and <varname>$symbolic</varname> will be added to it. - So, in our second example, the source contains a file with symbolic name + If <varname>$URL</varname> is a file, + then only the filename will be kept, + and + <varname>$symbolic</varname> + will be added to it. + + So, + in our second example, + the source contains a file with symbolic name <literal>file.txt</literal>. + If a symbolic name <literal>foo</literal> had been specified, the source would contain <literal>foo/file.txt</literal>. </para> @@ -112,17 +137,22 @@ <para> The <varname>$uncompression</varname> parameter indicate how many files will be uncompressed while parsing the tree to files. + By default the files are not uncompressed. + So, if you do - <command>File_Archive::read('archive.tar/inner/dir', 'inner/dir')</command>, - and if <filename>archive.tar</filename> contains a file called - <filename>archive.tar/inner/dir/file.tgz</filename>, this second archive - will appear as a file and not as a directory. - It won't be uncompressed because <varname>$uncompression</varname> is - <literal>0</literal>. + <command>File_Archive::read('archive.tar/inner/dir', 'inner/dir')</command>, + and if <filename>archive.tar</filename> contains a file called + <filename>archive.tar/inner/dir/file.tgz</filename>, this second archive + will appear as a file and not as a directory. + + It won't be uncompressed because <varname>$uncompression</varname> + is <literal>0</literal>. + If <varname>$uncompression</varname> is set to <literal>1</literal>, - <filename>file.tgz</filename> would appear as a directory, - but the files inside this archive would not be uncompressed. + <filename>file.tgz</filename> would appear as a directory, + but the files inside this archive would not be uncompressed. + If <varname>$uncompression</varname> is set to <literal>-1</literal>, all the files would be uncompressed, regardless of the depth. </para> @@ -135,8 +165,9 @@ </note> <para> - The <varname>$directoryDepth</varname> parameter gives a limit to the - number of directory read by the reader. + The <varname>$directoryDepth</varname> parameter + gives a limit to the number of directory + read by the reader. </para> </refsect1> @@ -146,7 +177,9 @@ <title>Multi readers</title> <para> - Using a multi reader, you can make several sources appear as one. + Using a multi reader, + you can make several sources appear as one. + You can create a multi reader using the <command>File_Archive::readMulti()</command> function. </para> @@ -177,7 +210,9 @@ <listitem> <para><command>function next()</command></para> <para> - Go to the next file in the source. Returns <literal>false</literal> + Go to the next file in the source. + + Returns <literal>false</literal> when the end of the archive is reached. </para> </listitem> @@ -185,15 +220,19 @@ <listitem> <para><command>function getFilename()</command></para> <para> - Returns the filename of the currently selected entry in the archive. + Returns the filename + of the currently selected entry + in the archive. </para> </listitem> <listitem> <para><command>function getStat()</command></para> <para> - Returns the stat as the <function>stat</function> function does - This function may not return a complete array, it may even return + Returns the stat as the <function>stat</function> function does. + + This function may not return a complete array, + it may even return <literal>array()</literal>. </para> </listitem> @@ -201,9 +240,11 @@ <listitem> <para><command>function getDataFilename()</command></para> <para> - For optimisation purposes: if the source is a physical file, - this function returns the name of the file; otherwise - it returns <literal>null</literal>. + For optimisation purposes: + if the source is a physical file, + this function returns the name of the file; + otherwise it returns + <literal>null</literal>. </para> </listitem> @@ -211,6 +252,7 @@ <para><command>function getData($length = -1)</command></para> <para> Reads some data from the source. + This function will return a string which size is determined by the smallest of <itemizedlist> @@ -226,7 +268,8 @@ </para> </listitem> </itemizedlist> - If the end of the file is reached, the function will return + If the end of the file is reached, + the function will return <literal>null</literal>. </para> </listitem> @@ -234,9 +277,11 @@ <listitem> <para><command>function skip($length)</command></para> <para> - Equivalent to <command>getData($length)</command>, but does not return - any data. - Depending on the data reader, this function can be far more efficient + Equivalent to <command>getData($length)</command>, + but does not return any data. + + Depending on the data reader, + this function can be far more efficient than <function>getData</function>. </para> </listitem> @@ -245,10 +290,14 @@ <para><command>function close()</command></para> <para> Should be called after having used the data reader - (closes the file handles...). - This function moves the object in the same state as it was before the - first call to <function>next</function>. - After this call, you can iterate again on the data reader. + (closes the file handles...). + + This function moves the object in the same state + as it was before the first call to + <function>next</function>. + + After this call, + you can iterate again on the data reader. </para> </listitem> </itemizedlist> @@ -272,14 +321,18 @@ <title>Functions that use readers</title> <para> - All <classname>File_Archive</classname> functions that take a reader as an - argument also accept strings and arrays. + All <classname>File_Archive</classname> + functions that take a reader as an + argument also accept strings and arrays. + The strings will be automatically interpreted as a reader using <command>File_Archive::read</command> function. + The arrays will be interpreted as a multi reader. </para> <para> - Since the readers are passed by reference, you will have to pass a variable + Since the readers are passed by reference, + you will have to pass a variable and not the raw string or array. </para> <para>