Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: ZipArchive::close(): Invalid or uninitialized Zip object
- foreach( glob($sourcedir.'*.[zZ][iI][pP]') as $zippath)
- {
- // create daily zip file
- $zipname = preg_replace('~'.$sourcedir.'~','',$zippath);
- $zipname2 = preg_replace('~.zip~','',$zipname);
- $zip = new ZipArchive();
- $ret = $zip->open($xmlzip.$zipname2.'_contact_xml.zip', ZipArchive::OVERWRITE);
- // move xml files to daily zip file created above
- if ($ret !== TRUE) {
- printf('Failed with code %d', $ret);
- } else {
- foreach(glob($source_file_path.'*.[xX][mM][lL]') as $xmlpath){
- $zip->addFile($xmlpath, preg_replace('~'.$source_file_path.'~','',$xmlpath));
- }
- }
- $zip->close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement