mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-18 18:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@195136 c90b9560-bf6c-de11-be94-00142212c4b1
192 lines
4.3 KiB
XML
192 lines
4.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- Purpose: compression -->
|
|
<!-- Membership: pecl, external -->
|
|
|
|
<reference id="ref.rar">
|
|
<title>Rar Functions</title>
|
|
<titleabbrev>Rar</titleabbrev>
|
|
|
|
<partintro>
|
|
|
|
<section id="rar.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
Rar is a powerful and effective archiver created by Eugene Roshal.
|
|
This extension gives you possibility to read Rar archives but
|
|
doesn't support writing Rar archives, because this is not supported
|
|
by UnRar library and is directly prohibited by it's license.
|
|
</para>
|
|
<para>
|
|
More information about Rar and UnRar can be found at <ulink
|
|
url="&url.rar;">&url.rar;</ulink>.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="rar.requirements">
|
|
&reftitle.required;
|
|
&no.requirement;
|
|
</section>
|
|
|
|
&reference.rar.ini;
|
|
|
|
<section id="rar.install">
|
|
&reftitle.install;
|
|
<para>
|
|
Rar is currently available through PECL
|
|
<ulink url="&url.pecl.package;rar">&url.pecl.package;rar</ulink>.
|
|
</para>
|
|
<para>
|
|
Also you can use the pear installer to install the Rar extension,
|
|
using the following command: <command>pear -v install rar</command>.
|
|
</para>
|
|
<para>
|
|
You can always download the tar.gz package and install Rar by hand:
|
|
<example>
|
|
<title>Rar installation</title>
|
|
<programlisting role="shell">
|
|
<![CDATA[
|
|
gunzip rar-xxx.tgz
|
|
tar -xvf rar-xxx.tar
|
|
cd rar-xxx
|
|
phpize
|
|
./configure && make && make install
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Windows users can download the extension dll <filename>php_rar.dll</filename>
|
|
here: <ulink url="&url.pecl.get.win;">&url.pecl.get.win;</ulink>.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="rar.resources">
|
|
&reftitle.resources;
|
|
<para>
|
|
There is one resource used in Rar extension: a file descriptor returned
|
|
by <function>rar_open</function>.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="rar.constants">
|
|
&reftitle.constants;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<constant>RAR_HOST_MSDOS</constant>
|
|
(<type>integer</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<constant>RAR_HOST_OS2</constant>
|
|
(<type>integer</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<constant>RAR_HOST_WIN32</constant>
|
|
(<type>integer</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<constant>RAR_HOST_UNIX</constant>
|
|
(<type>integer</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<constant>RAR_HOST_BEOS</constant>
|
|
(<type>integer</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
|
|
<section id="rar.examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Rar extension overview example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
|
|
|
|
$entries = rar_list($rar_file);
|
|
|
|
foreach ($entries as $entry) {
|
|
echo 'Filename: ' . $entry->getName() . "\n";
|
|
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
|
|
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
|
|
|
|
$entry->extract('/dir/extract/to/');
|
|
}
|
|
|
|
rar_close($rar_file);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
This example opens a Rar file archive and extracts each entry to the
|
|
specified directory.
|
|
</para>
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
&reference.rar.functions;
|
|
|
|
</reference>
|
|
<!-- 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
|
|
-->
|
|
|