summaryrefslogtreecommitdiff
path: root/ext/zip
diff options
context:
space:
mode:
authorAdam Harvey <aharvey@php.net>2011-01-28 04:19:40 +0000
committerAdam Harvey <aharvey@php.net>2011-01-28 04:19:40 +0000
commitc5f06eff159e856750f2a81774b05e7c693db382 (patch)
tree2d80cae4a7ce6b873295903a24bc09aa37da4b7e /ext/zip
parent6bf5a8593b2ccd551ea6bd79c1faf43cf11c9e5d (diff)
downloadphp-git-c5f06eff159e856750f2a81774b05e7c693db382.tar.gz
Fixed bug #53854 (Missing constants for compression type). Patch by Richard
Quadling.
Diffstat (limited to 'ext/zip')
-rw-r--r--ext/zip/php_zip.c6
-rw-r--r--ext/zip/tests/bug53854.phpt44
2 files changed, 50 insertions, 0 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 6c38e4b183..7385a602b0 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -2752,6 +2752,12 @@ static PHP_MINIT_FUNCTION(zip)
REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE", ZIP_CM_DEFLATE);
REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE64", ZIP_CM_DEFLATE64);
REGISTER_ZIP_CLASS_CONST_LONG("CM_PKWARE_IMPLODE", ZIP_CM_PKWARE_IMPLODE);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_BZIP2", ZIP_CM_BZIP2);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_LZMA", ZIP_CM_LZMA);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_TERSE", ZIP_CM_TERSE);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_LZ77", ZIP_CM_LZ77);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_WAVPACK", ZIP_CM_WAVPACK);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_PPMD", ZIP_CM_PPMD);
/* Error code */
REGISTER_ZIP_CLASS_CONST_LONG("ER_OK", ZIP_ER_OK); /* N No error */
diff --git a/ext/zip/tests/bug53854.phpt b/ext/zip/tests/bug53854.phpt
new file mode 100644
index 0000000000..cd8ae7e5f3
--- /dev/null
+++ b/ext/zip/tests/bug53854.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #53854 (Missing constants for compression type)
+--SKIPIF--
+<?php
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+var_dump(ZipArchive::CM_DEFAULT);
+var_dump(ZipArchive::CM_STORE);
+var_dump(ZipArchive::CM_SHRINK);
+var_dump(ZipArchive::CM_REDUCE_1);
+var_dump(ZipArchive::CM_REDUCE_2);
+var_dump(ZipArchive::CM_REDUCE_3);
+var_dump(ZipArchive::CM_REDUCE_4);
+var_dump(ZipArchive::CM_IMPLODE);
+var_dump(ZipArchive::CM_DEFLATE);
+var_dump(ZipArchive::CM_DEFLATE64);
+var_dump(ZipArchive::CM_PKWARE_IMPLODE);
+var_dump(ZipArchive::CM_BZIP2);
+var_dump(ZipArchive::CM_LZMA);
+var_dump(ZipArchive::CM_TERSE);
+var_dump(ZipArchive::CM_LZ77);
+var_dump(ZipArchive::CM_WAVPACK);
+var_dump(ZipArchive::CM_PPMD);
+--EXPECT--
+int(-1)
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(8)
+int(9)
+int(10)
+int(12)
+int(14)
+int(18)
+int(19)
+int(97)
+int(98)