--TEST-- ZipArchive::addPattern() method --CREDITS-- Sammy Kaye Powers w/Kenzo over the shoulder #phptek Chicago 2014 --SKIPIF-- --FILE-- open($file)) { exit('failed'); } $dir = realpath($dirname); $options = array('add_path' => 'baz/', 'remove_path' => $dir); if (!$zip->addPattern('/\.txt$/', $dir, $options)) { echo "failed\n"; } if ($zip->status == ZIPARCHIVE::ER_OK) { if (!verify_entries($zip, [ "bar", "foobar/", "foobar/baz", "entry1.txt", "baz/foo.txt", "baz/bar.txt" ])) { echo "failed\n"; } else { echo "OK"; } $zip->close(); } else { echo "failed3\n"; } ?> --CLEAN-- --EXPECT-- OK