PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

rar_close> <radius_strerror
Last updated: Sun, 25 Nov 2007

view this page in

Rar Functions

Úvod

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.

More information about Rar and UnRar can be found at » http://www.rarlabs.com/.

Požiadavky

Žiadne externé knižnice nie sú potrebné na vybudovanie tohto rozšírenia.

Runtime Konfigurácia

Toto rozšírenie nemá žiadne konfiguračné direktívy definované v php.ini.

Inštalácia

Rar is currently available through PECL » http://pecl.php.net/package/rar.

Also you can use the PECL installer to install the Rar extension, using the following command: pecl -v install rar.

You can always download the tar.gz package and install Rar by hand:

Example#1 Rar installation

gunzip rar-xxx.tgz
tar -xvf rar-xxx.tar
cd rar-xxx
phpize
./configure && make && make install

Windows users can download the extension dll php_rar.dll here: » http://snaps.php.net/win32/PECL_STABLE/.

Typy zdrojov

There is one resource used in Rar extension: a file descriptor returned by rar_open().

Preddefinované Konštanty

RAR_HOST_MSDOS (integer)
RAR_HOST_OS2 (integer)
RAR_HOST_WIN32 (integer)
RAR_HOST_UNIX (integer)
RAR_HOST_BEOS (integer)

Príklady

Example#2 Rar extension overview example

<?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);

?>

This example opens a Rar file archive and extracts each entry to the specified directory.

Table of Contents



add a note add a note User Contributed Notes
Rar
Jacques Manukyan
21-Mar-2008 07:49
As an update to steve_php's comment down below, the extension is actual quite stable and it is out of beta.

The extension works quite well so don't be afraid to use it if you need it.
steve_php[at]nanovox[dart]com
11-Oct-2005 06:24
As of right now, rar is in a beta state, so you'll have to compile using: pear -v install -f rar

rar_close> <radius_strerror
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites