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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -