我想要php压缩类扩展来压缩目录,但没有临时文件

I want an extension to compress directory with all files and sub-dirs inside it, but without creating a temp files, i want the extrnsion name with a code for how to use it ?

i have an errors when the class making a temp files

Thank you ,

You want http://pablotron.org/software/zipstream-php/. From the documentation:

1.  Create the zip stream:

    $zip = new ZipStream('example.zip');

2.  Add one or more files to the archive:

    # add first file
    $data = file_get_contents('some_file.gif');
    $zip->add_file('some_file.gif', $data);

    # add second file
    $data = file_get_contents('some_file.gif');
    $zip->add_file('another_file.png', $data);

3.  Finish the zip stream:

    $zip->finish();

I will warn you: if you're dealing with very large files the zip will break. it works well on small files, but not on 10s of megabytes.