1--TEST-- 2ziparchive::addEmptyDir 3--SKIPIF-- 4<?php 5/* $Id$ */ 6if(!extension_loaded('zip')) die('skip'); 7?> 8--FILE-- 9<?php 10 11$dirname = dirname(__FILE__) . '/'; 12include $dirname . 'utils.inc'; 13$file = $dirname . '__tmp_oo_addfile.zip'; 14 15copy($dirname . 'test.zip', $file); 16 17$zip = new ZipArchive; 18if (!$zip->open($file)) { 19 exit('failed'); 20} 21 22$zip->addEmptyDir('emptydir'); 23if ($zip->status == ZIPARCHIVE::ER_OK) { 24 dump_entries_name($zip); 25 $zip->close(); 26} else { 27 echo "failed\n"; 28} 29@unlink($file); 30?> 31--EXPECTF-- 320 bar 331 foobar/ 342 foobar/baz 353 entry1.txt 364 emptydir/ 37