isSupported() ) { return PEAR::raiseError( 'RAR Extraction not supported by your PHP installation.' ) ; } $arch = rar_open($archive); if ($arch === FALSE) return PEAR::raiseError("Cannot open the rar archive"); $entries = rar_list($arch); if ($entries === FALSE) { return PEAR::raiseError("Cannot retrieve entries"); } foreach( $entries as $file ) { $file->extract( $destination ); } return true; } /** * Method to determine if the server has native zip support for faster handling * * @access public * @return boolean True if php has native ZIP support * @since 1.5 */ function isSupported() { return (extension_loaded( 'rar' ) && class_exists( 'RarArchive' )) ; } }