1
culex
Creating zip files with php < 5.20
  • 2010/1/16 22:21

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


hey there,

Just finishing up some tweaking of indexscan module.

I finished allready the single file delete, auto deleting files for instance (Thumbs.db) // If set to do so in config of course

Also I have created a create backup of folders where output goes into another folder (backedup) and contains nothing but the empty folders and index.html where no index folders exists in original. (nice in developing to auto create index.html files)..

However I have been looking at the opportunity to present the result to user as zip file, and was thinking to recursively add files to zip using sonmething like this

function indexscan_createZip ($folder$name) {
$dir_iterator = new RecursiveDirectoryIterator($folder);
    
$iterator = new RecursiveIteratorIterator($dir_iteratorRecursiveIteratorIterator::SELF_FIRST);
    foreach(
$iterator as $ff) {
        if (
$ff->IsFile()) {
            
// add $ff to zip($name) ???
        
}
    }
}


Does a class exist for creating zip files like this in XOOPS and php < 5.20 ? and how excactely to do it if there does ?

2
ghia
Re: Creating zip files with php < 5.20
  • 2010/1/16 23:26

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Check out the lang_tool module 0.76. It contains a function to zip language directories and download them.
(I think it ran in all PHP versions.)

Login

Who's Online

243 user(s) are online (178 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits