How can I make a compressed archive from a local file with ZF2 Zend\Filter\Compress
?
I wrote this code:
$filter = new Zend\Filter\Compress(array(
'adapter' => 'Gz',
'options' => array(
'archive' => "/local/lnx/archive.gz",
),
));
$compressed = $filter->filter("/local/lnx/file.txt");
It make a new archive in /local/lnx/
but it contain a file without extension that contain the string /local/lnx/file.txt
. But I don't want that, I would like to have an archive that contain the FILE file.txt
not its name. Where is my error?