Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No strategy for .tbz? #128

Open
jpmurray opened this issue Mar 20, 2017 · 5 comments
Open

No strategy for .tbz? #128

jpmurray opened this issue Mar 20, 2017 · 5 comments

Comments

@jpmurray
Copy link

Just checking here, I might be doing something wrong (since the doc says it handles that extension), but trying to extract a .tbz file like so:

$archive = $zippy->open($file);
$archive->extract($extractTo);

will fail with two errors [Alchemy\Zippy\Exception\RuntimeException] Unable to open archive (Zippy.php:94) and [Alchemy\Zippy\Exception\FormatNotSupportedException] No strategy for extension (Zippy.php:151).

How could I debug this? I'm actually not sure here: is the problem opening the file, or is it that it doesn't find strategies for it?

@fabre-thibaud
Copy link
Contributor

It's not finding a strategy for the TBZ extension. I checked, there is only support for .tbz2 files currently, not .tbz.

@jpmurray
Copy link
Author

OH! Good to know.

I've been checking to make a PR to the docs so I could remove it from the index (https://zippy.readthedocs.io/en/latest/), but I'm honestly not finding where the file is exactly, so I'll leave it to you ;-)

@jpmurray
Copy link
Author

@fabre-thibaud I just discovered that .tbz files are just .tar.bz2files.

Giving explicitly the strategy like so works perfectly fine.

$archive = $zippy->open($file, '.tar.bz2');
$archive->extract($extractTo);

@fabre-thibaud
Copy link
Contributor

fabre-thibaud commented Mar 21, 2017

Good find, forgot about that. I'll still update the library one of these days to add "native" support for that extension.

Edit. The catch is that currently each strategy is only bound to a single extension. It would be probably be a good idea to add support for multiple extensions per strategy.

@jpmurray
Copy link
Author

I think that would be wise, and probably easier for you in the long run! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants