Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Archive Laravel Package

joomla/archive

Joomla Archive intelligently selects adapters to extract common archives (zip, tar/tgz/tbz2, gz, bz2). Supports PHP 8.1+, with optional zlib/bz2 extensions, and lets you override default extractors by registering custom adapters.

View on GitHub
Deep Wiki
Context7

The Archive Package Build Status

Latest Stable Version Total Downloads Latest Unstable Version License

The archive package will intelligently load the correct adapter for the specified archive type. It knows how to properly handle the following archive types:

  • zip
  • tar | tgz | tbz2
  • gz | gzip
  • bz2 | bzip2

Loading files of the t* archive type will uncompress the archive using the appropriate adapter, and then extract via tar.

Requirements

  • PHP 8.1 or later
  • zlib extension for GZip support
  • bz2 extension for BZip2 support

Usage

$options = array('tmp_path' => '/tmp');

$archive = new Joomla\Archive\Archive($options)

$archive->extract(__DIR__ . '/archive.zip', __DIR__ . '/destination');

Overriding Adapters

If you have a custom adapter you would like to use for extracting, this package allows you to override the defaults. Just implement ExtractableInterface when creating your adapter, and then use the setAdapter method to override.


class MyZipAdapter implements \Joomla\Archive\ExtractableInterface
{
	public static function isSupported()
	{
		// Do you test
		return true;
	}

	public function extract($archive, $destination)
	{
		// Your code
	}
}

$archive = new Archive;

// You need to pass the fully qualified class name.
$archive->setAdapter('zip', '\\MyZipAdapter');

// This will use your
$archive->extract('archive.zip', 'destination');

Installation via Composer

Add "joomla/archive": "~3.0" to the require block in your composer.json and then run composer install.

{
	"require": {
		"joomla/archive": "~3.0"
	}
}

Alternatively, you can simply run the following from the command line:

composer require joomla/archive "~3.0"

If you want to include the test sources, use

composer require --prefer-source joomla/archive "~3.0"
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope