ZipArchive::addEmptyDir is not creating empty dir in ubuntu 3.15 & PHP 5.3.10 -
i'm trying add empty director archive, using following code in ubuntu3.15 running php 5.3.10. creating zip without empty directory in it. idea what's wrong in code?
$zip = new ziparchive(); $filename = "/var/www/enteliweb/website/public/test.zip"; if ($zip->open($filename, ziparchive::create)!==true) { exit("cannot open <$filename>\n"); } if($zip->addemptydir('newdirectory')) { echo 'created new root directory'; } else { echo 'could not create directory'; } $zip->close();
Comments
Post a Comment