note 117695 rejected from ziparchive.addemptydir by cmb
| From: | cmb@php.net | Date: | Thu, 23 Jul 2015 23:40:45 +0000 |
| Subject: | note 117695 rejected from ziparchive.addemptydir by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203169@lists.php.net to get a copy of this message | ||
Note Submitter: apasha at deltacontrols dot com
----
Not able to add empty directory in ubuntu3.15 running PHP version 5.3.10 by using the following
code.
<?php
$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 a new root directory';
} else {
echo 'Could not create the directory';
}
$zip->close();
?>