aharvey                                  Fri, 28 Jan 2011 04:19:40 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=307807

Log:
Fixed bug #53854 (Missing constants for compression type). Patch by Richard
Quadling.

Bug: http://bugs.php.net/53854 (Assigned) Missing constants for compression 
type.
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/zip/php_zip.c
    A   php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt
    U   php/php-src/trunk/UPGRADING
    U   php/php-src/trunk/ext/zip/php_zip.c
    A   php/php-src/trunk/ext/zip/tests/bug53854.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2011-01-28 04:17:08 UTC (rev 307806)
+++ php/php-src/branches/PHP_5_3/NEWS   2011-01-28 04:19:40 UTC (rev 307807)
@@ -146,6 +146,7 @@
     gmail dot com, Gustavo)
   . Fixed bug #53166 (Missing parameters in docs and reflection definition).
     (Richard)
+  . Fixed bug #53854 (Missing constants for compression type). (Richard, Adam)

 06 Jan 2011, PHP 5.3.5
 - Fixed Bug #53632 (infinite loop with x87 fpu). (CVE-2010-4645) (Scott,

Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c      2011-01-28 04:17:08 UTC 
(rev 307806)
+++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c      2011-01-28 04:19:40 UTC 
(rev 307807)
@@ -2754,6 +2754,12 @@
        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 */

Added: php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt                    
        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt    2011-01-28 
04:19:40 UTC (rev 307807)
@@ -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)

Modified: php/php-src/trunk/UPGRADING
===================================================================
--- php/php-src/trunk/UPGRADING 2011-01-28 04:17:08 UTC (rev 307806)
+++ php/php-src/trunk/UPGRADING 2011-01-28 04:19:40 UTC (rev 307807)
@@ -371,7 +371,12 @@

      i. New class constants

-       -
+       - ZipArchive::CM_BZIP2
+       - ZipArchive::CM_LZ77
+       - ZipArchive::CM_LZMA
+       - ZipArchive::CM_PPMD
+       - ZipArchive::CM_TERSE
+       - ZipArchive::CM_WAVPACK

      j. New Hash algorithms


Modified: php/php-src/trunk/ext/zip/php_zip.c
===================================================================
--- php/php-src/trunk/ext/zip/php_zip.c 2011-01-28 04:17:08 UTC (rev 307806)
+++ php/php-src/trunk/ext/zip/php_zip.c 2011-01-28 04:19:40 UTC (rev 307807)
@@ -2752,6 +2752,12 @@
        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 */

Added: php/php-src/trunk/ext/zip/tests/bug53854.phpt
===================================================================
--- php/php-src/trunk/ext/zip/tests/bug53854.phpt                               
(rev 0)
+++ php/php-src/trunk/ext/zip/tests/bug53854.phpt       2011-01-28 04:19:40 UTC 
(rev 307807)
@@ -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)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to