Most Referenced Functions
  » google_pagerank()
  » preg_replace()
  » imagecreatefrompng()
  » site_pageranks()
  » imagepng()
  » imagedestroy()
  » imagestring()
  » imagecolorallocate()
  » htmlentities()
  » preg_match()
  » fopen()
  » header()
  » getimagesize()
  » preg_match_all()
  » session_start()
  » htmlspecialchars()
  » ob_start()
  » ob_flush()
  » strstr()
  » flush()
  » strpos()
  » setcookie()
  » str_replace()
  » array2vars()
  » nl2br()
  » preg_split()
  » ereg()
  » ereg_replace()
  » urlencode()
  » readgzfile()

Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m.

PHP Functions

Function: radius_strerror

(PECL)

radius_strerror -- Returns an error message

Description

string radius_strerror ( resource radius_handle )

If Radius-functions fail then they record an error message. This error message can be retrieved with this function.

Return Values

Returns error messages as string from failed radius functions.

CXIII. Rar Functions

Introduction

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/ .

Requirements

No external libraries are needed to build this extension.

Runtime Configuration

This extension has no configuration directives defined in php.ini .

Installation

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

Also you can use the pear installer to install the Rar extension, using the following command: pear -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/ .

Resource Types

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

Predefined Constants

RAR_HOST_MSDOS ( integer )

RAR_HOST_OS2 ( integer )

RAR_HOST_WIN32 ( integer )

RAR_HOST_UNIX ( integer )

RAR_HOST_BEOS ( integer )

Examples

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 rar_close  -- Close Rar archive and free all resources rar_entry_get  -- Get entry object from the Rar archive Rar::extract  -- Extract entry from the archive Rar::getAttr  -- Get attributes of the entry Rar::getCrc  -- Get CRC of the entry Rar::getFileTime  -- Get entry last modification time Rar::getHostOs  -- Get entry host OS Rar::getMethod  -- Get pack method of the entry Rar::getName  -- Get name of the entry Rar::getPackedSize  -- Get packed size of the entry Rar::getUnpackedSize  -- Get unpacked size of the entry Rar::getVersion  -- Get version of the archiver used to add the entry rar_list  -- Get entries list from the Rar archive rar_open  -- Open Rar archive

Related Function(s)

  • rar_open()
  • rar_close()
  • rar_entry_get()
  • Rar_extract()
  • Rar_getAttr()
  • Rar_getCrc()
  • Rar_getFileTime()
  • Rar_getHostOs()
  • Rar_getMethod()
  • Rar_getName()
  • Rar_getPackedSize()
  • Rar_getUnpackedSize()
  • Rar_getVersion()
  • rar_list()
  • Icemelon -- PHP, CSS, Javascript Tutorials, & More!
      © 2005-2010 Icemelon.com   Email: dave[AT]icemelon[D0T]c0m