ZipArchive::setCompressionName
Set the compression method of an entry defined by its name
&reftitle.description;
boolZipArchive::setCompressionName
stringname
intcomp_method
intcomp_flags0
Set the compression method of an entry defined by its name.
&reftitle.parameters;
name
Name of the entry.
comp_method
The compression method. Either
ZipArchive::CM_DEFAULT,
ZipArchive::CM_STORE or
ZipArchive::CM_DEFLATE.
comp_flags
Compression flags. Currently unused.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
Add files with different compression methods to an archive
open('test.zip', ZipArchive::CREATE);
if ($res === TRUE) {
$zip->addFromString('foo', 'Some text');
$zip->addFromString('bar', 'Some other text');
$zip->setCompressionName('foo', ZipArchive::CM_STORE);
$zip->setCompressionName('bar', ZipArchive::CM_DEFLATE);
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
]]>