takuya/unar-wrapper

php wrapper of UnArchiver commad line tool.

0.1 2021-03-02 10:02 UTC

This package is auto-updated.

Last update: 2024-04-29 04:53:28 UTC


README

<ORG_NAME>

Unarchive command line tools wrapper

no compress, only for extract. but many formats can use.

Why this package written.

To deal in same way several archive formats ( zip/tar/rar ).

support formats.

depends on unar ( Unarvhive command line tool ).

zip / rar(winrar) / tar.gz works fine.

Installing

composer require takuya/php-unar-wrapper

How to use

<?php

require_once 'vendor/autoload.php';

use SystemUtil\Archiver\UnArchiver;

$sample_zip = 'sample.zip';
$ar = new UnArchiver();
$ar->open($sample_zip);
foreach( $ar->list('*.jpg') as $name => $entry ){
  var_dump([$name,$entry->contents()]);
}

?>

requirement

UnArchiver commad line tools.

sudo apt install unar

More samples.

See samples/ in repositry.