guny
guny

Reputation: 197

How to get files inside the folder to be zip Archive

$source = "/Filelist/"
$filter = new Zend_Filter_Compress(
    array(
        'adapter' => 'Zip',
        'options' => array(
            'archive' => test.zip
        )
    )                     
);
$result = $filter->filter($source);

The function works fine, the problem is that I want to get the file list inside the test.zip. However now I am getting the folder Filelist inside the archive.

It seems to be because of this line:

$content = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, realpath($content));

and the realpath is removing /. How do I resolve this?

Upvotes: 2

Views: 842

Answers (1)

robertlbolton
robertlbolton

Reputation: 168

Looking at the code, I don't see a way of doing that. Zend_Filter_Compress_Zip checks if it is a dir, and if it is, calls:

$zip->addEmptyDir(substr($local, 0, -1));

Upvotes: 0

Related Questions