mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
add Rar reference
#please, check my English, I'm not a native speaker #thanks git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@168995 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
691de62b84
commit
d25ebd2a62
16 changed files with 1061 additions and 0 deletions
65
reference/rar/functions/Rar-extract.xml
Normal file
65
reference/rar/functions/Rar-extract.xml
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-extract">
|
||||
<refnamediv>
|
||||
<refname>Rar::extract</refname>
|
||||
<refpurpose>Extract entry from the archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>Rar::extract</methodname>
|
||||
<methodparam><type>string</type><parameter>dir</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>filepath</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::extract</function> extracts entry's data to the
|
||||
<parameter>dir</parameter>. It will create new file in the specified
|
||||
<parameter>dir</parameter> with the name identical to the entry's name.
|
||||
If parameter <parameter>filepath</parameter> is specified instead
|
||||
<parameter>dir</parameter>, <function>Rar::extract</function> will extract
|
||||
entry's data to the specified file.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::extract</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
$entry->extract('/dir/to'); // create /dir/to/Dir/file.txt
|
||||
$entry->extract(false, '/dir/to/new_name.txt'); // create /dir/to/new_name.txt
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
&return.success;
|
||||
</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
|
||||
-->
|
105
reference/rar/functions/Rar-getAttr.xml
Normal file
105
reference/rar/functions/Rar-getAttr.xml
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getAttr">
|
||||
<refnamediv>
|
||||
<refname>Rar::getAttr</refname>
|
||||
<refpurpose>Get attributes of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getAttr</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getAttr</function> returns attributes of the archive
|
||||
entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getAttr</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'dir/in/the/archive') or die("Can't find such entry");
|
||||
|
||||
$host_os = $entry->getHostOs();
|
||||
$attr = $entry->getAttr();
|
||||
|
||||
switch($host_os) {
|
||||
case RAR_HOST_MSDOS:
|
||||
case RAR_HOST_OS2:
|
||||
case RAR_HOST_WIN32:
|
||||
case RAR_HOST_MACOS:
|
||||
printf("%c%c%c%c%c%c\n",
|
||||
($attr & 0x08) ? 'V' : '.',
|
||||
($attr & 0x10) ? 'D' : '.',
|
||||
($attr & 0x01) ? 'R' : '.',
|
||||
($attr & 0x02) ? 'H' : '.',
|
||||
($attr & 0x04) ? 'S' : '.',
|
||||
($attr & 0x20) ? 'A' : '.');
|
||||
break;
|
||||
case RAR_HOST_UNIX:
|
||||
case RAR_HOST_BEOS:
|
||||
switch ($attr & 0xF000)
|
||||
{
|
||||
case 0x4000:
|
||||
printf("d");
|
||||
break;
|
||||
case 0xA000:
|
||||
printf("l");
|
||||
break;
|
||||
default:
|
||||
printf("-");
|
||||
break;
|
||||
}
|
||||
printf("%c%c%c%c%c%c%c%c%c\n",
|
||||
($attr & 0x0100) ? 'r' : '-',
|
||||
($attr & 0x0080) ? 'w' : '-',
|
||||
($attr & 0x0040) ? (($attr & 0x0800) ? 's':'x'):(($attr & 0x0800) ? 'S':'-'),
|
||||
($attr & 0x0020) ? 'r' : '-',
|
||||
($attr & 0x0010) ? 'w' : '-',
|
||||
($attr & 0x0008) ? (($attr & 0x0400) ? 's':'x'):(($attr & 0x0400) ? 'S':'-'),
|
||||
($attr & 0x0004) ? 'r' : '-',
|
||||
($attr & 0x0002) ? 'w' : '-',
|
||||
($attr & 0x0001) ? 'x' : '-');
|
||||
break;
|
||||
}
|
||||
|
||||
rar_close($rar_file);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getAttr</function> returns &false; on error.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>Rar::getHostOs</function>.
|
||||
</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
|
||||
-->
|
52
reference/rar/functions/Rar-getCrc.xml
Normal file
52
reference/rar/functions/Rar-getCrc.xml
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getCrc">
|
||||
<refnamediv>
|
||||
<refname>Rar::getCrc</refname>
|
||||
<refpurpose>Get CRC of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getCrc</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getCrc</function> returns CRC of the archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getCrc</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getCrc</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
53
reference/rar/functions/Rar-getFileTime.xml
Normal file
53
reference/rar/functions/Rar-getFileTime.xml
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getFileTime">
|
||||
<refnamediv>
|
||||
<refname>Rar::getFileTime</refname>
|
||||
<refpurpose>Get entry last modification time</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>Rar::getFileTime</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getFileTime</function> returns entry last modification
|
||||
time as string in format YYYY-MM-DD HH:II:SS.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getFileTime</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
78
reference/rar/functions/Rar-getHostOs.xml
Normal file
78
reference/rar/functions/Rar-getHostOs.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getHostOs">
|
||||
<refnamediv>
|
||||
<refname>Rar::getHostOs</refname>
|
||||
<refpurpose>Get entry host OS</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getHostOs</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getHostOs</function> return code of the host OS of the
|
||||
archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getHostOs</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
switch ($entry->getHostOs()) {
|
||||
case RAR_HOST_MSDOS:
|
||||
echo "MS-DOS\n";
|
||||
break;
|
||||
case RAR_HOST_OS2:
|
||||
echo "OS2\n";
|
||||
break;
|
||||
case RAR_HOST_WIN32:
|
||||
echo "Win32\n";
|
||||
break;
|
||||
case RAR_HOST_MACOS:
|
||||
echo "MacOS\n";
|
||||
break;
|
||||
case RAR_HOST_UNIX:
|
||||
echo "Unix/Linux\n";
|
||||
break;
|
||||
case RAR_HOST_BEOS:
|
||||
echo "BeOS\n";
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getHostOs</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
59
reference/rar/functions/Rar-getMethod.xml
Normal file
59
reference/rar/functions/Rar-getMethod.xml
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getMethod">
|
||||
<refnamediv>
|
||||
<refname>Rar::getMethod</refname>
|
||||
<refpurpose>Get pack method of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getMethod</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getMethod</function> returns number of the method used when adding
|
||||
current archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getMethod</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
echo "Method number: " . $entry->getMethod();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getMethod</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
58
reference/rar/functions/Rar-getName.xml
Normal file
58
reference/rar/functions/Rar-getName.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getName">
|
||||
<refnamediv>
|
||||
<refname>Rar::getName</refname>
|
||||
<refpurpose>Get name of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>Rar::getName</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>Rar::getName</function> returns full name of the archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getName</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
echo "Entry name: " . $entry->getName();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getName</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
58
reference/rar/functions/Rar-getPackedSize.xml
Normal file
58
reference/rar/functions/Rar-getPackedSize.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getPackedSize">
|
||||
<refnamediv>
|
||||
<refname>Rar::getPackedSize</refname>
|
||||
<refpurpose>Get packed size of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getPackedSize</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get packed size of the archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
echo "Packed size of " . $entry->getName() . " = " . $entry->getPackedSize() . " bytes";
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getPackedSize</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
58
reference/rar/functions/Rar-getUnpackedSize.xml
Normal file
58
reference/rar/functions/Rar-getUnpackedSize.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getUnpackedSize">
|
||||
<refnamediv>
|
||||
<refname>Rar::getUnpackedSize</refname>
|
||||
<refpurpose>Get unpacked size of the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getUnpackedSize</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get unpacked size of the archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getUnpackedSize</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
echo "Unpacked size of " . $entry->getName() . " = " . $entry->getPackedSize() . " bytes";
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getUnpackedSize</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
58
reference/rar/functions/Rar-getVersion.xml
Normal file
58
reference/rar/functions/Rar-getVersion.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.Rar-getVersion">
|
||||
<refnamediv>
|
||||
<refname>Rar::getVersion</refname>
|
||||
<refpurpose>Get version of the archiver used to add the entry</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>Rar::getVersion</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get version of the archiver used to add the archive entry.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::getVersion</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
echo "Rar (WinRAR) version used: " . $entry->getVersion();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>Rar::getVersion</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
42
reference/rar/functions/rar-close.xml
Normal file
42
reference/rar/functions/rar-close.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.rar-close">
|
||||
<refnamediv>
|
||||
<refname>rar_close</refname>
|
||||
<refpurpose>Close Rar archive and free all resources</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>rar_close</methodname>
|
||||
<methodparam><type>resource</type><parameter>rar_file</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Close Rar archive and free all allocated resources.
|
||||
</para>
|
||||
<para>
|
||||
<function>rar_close</function> returns &false; on error.
|
||||
</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
|
||||
-->
|
59
reference/rar/functions/rar-entry-get.xml
Normal file
59
reference/rar/functions/rar-entry-get.xml
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.rar-entry-get">
|
||||
<refnamediv>
|
||||
<refname>rar_entry_get</refname>
|
||||
<refpurpose>Get entry object from the Rar archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>rar_entry_get</methodname>
|
||||
<methodparam><type>resource</type><parameter>rar_file</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>entry_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get entry object from the Rar archive.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
|
||||
|
||||
print_r($entry);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>rar_get_entry</function> returns entry object or &false; on error.
|
||||
</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
|
||||
-->
|
58
reference/rar/functions/rar-list.xml
Normal file
58
reference/rar/functions/rar-list.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.rar-list">
|
||||
<refnamediv>
|
||||
<refname>rar_list</refname>
|
||||
<refpurpose>Get entries list from the Rar archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>rar_list</methodname>
|
||||
<methodparam><type>resource</type><parameter>rar_file</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get entries list from the Rar archive.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>Rar::</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
|
||||
|
||||
$entries_list = rar_list($rar_file);
|
||||
|
||||
print_r($entries_list);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<function>rar_list</function> returns array of entries or &false; on error.
|
||||
</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
|
||||
-->
|
42
reference/rar/functions/rar-open.xml
Normal file
42
reference/rar/functions/rar-open.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.rar-open">
|
||||
<refnamediv>
|
||||
<refname>rar_open</refname>
|
||||
<refpurpose>Open Rar archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>rar_open</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Open specified Rar archive and return Rar file resource.
|
||||
</para>
|
||||
<para>
|
||||
<function>rar_open</function> returns Rar file resource or &false; on error.
|
||||
</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
|
||||
-->
|
27
reference/rar/ini.xml
Normal file
27
reference/rar/ini.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<section id="rar.configuration">
|
||||
&reftitle.runtime;
|
||||
&no.config;
|
||||
</section>
|
||||
|
||||
<!-- 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
|
||||
-->
|
189
reference/rar/reference.xml
Normal file
189
reference/rar/reference.xml
Normal file
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<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
|
||||
-->
|
||||
|
Loading…
Reference in a new issue