Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Zend\Filter\Compress\Tar decompress #41

Closed
intruder897 opened this issue Sep 15, 2016 · 0 comments · Fixed by #92
Closed

Zend\Filter\Compress\Tar decompress #41

intruder897 opened this issue Sep 15, 2016 · 0 comments · Fixed by #92
Labels
Milestone

Comments

@intruder897
Copy link

intruder897 commented Sep 15, 2016

To decompress a tar archive i must provide 'archive' parameter to constructor:

$filter = new Decompress([
    'adapter' => 'Tar',
    'options' => [
        'target' => '/path/where/to/extract/archive',
        'archive' => '/path/to/archive.tar',
    ],
]);

otherwise when i'm doing a decompression

$decompressed = $filter->filter('/path/to/archive.tar');

it throws and exception 'Tar Archive not found'.

I think that there are unlogical code in the decompress method:

$archive = $this->getArchive();
if (empty($archive) || !file_exists($archive)) {
    throw new Exception\RuntimeException('Tar Archive not found');
}

because $archive variable is redefining at the next line:

$archive = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, realpath($content));

Maybe this code must be removed or reworked to avoid double passing an archive variable during decompress.

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

Successfully merging a pull request may close this issue.

3 participants