开发者

how to get files inside the folder to be zip Archive

开发者 https://www.devze.com 2023-02-22 05:55 出处:网络
$sour开发者_高级运维ce=\"/Filelist/\" $filter = new Zend_Filter_Compress( array( \'adapter\' => \'Zip\',
  $sour开发者_高级运维ce="/Filelist/"
 $filter = new Zend_Filter_Compress(
                        array(
                        'adapter' => 'Zip',
                        'options' => array(
                                                        'archive' => test.zip
                                                      )
                                )                     
                    );
       $result = $filter->filter($source);

the function work fine ,the problem is that i want to get the file list inside the test.zip .but now i am getting the folder Filelist inside the archive.

it seems to because of line $content = str_replace(array('/', '\'), DIRECTORY_SEPARATOR, realpath($content)); and the realpath is removing '/' Any solution ????????????????


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));
0

精彩评论

暂无评论...
验证码 换一张
取 消