]> granicus.if.org Git - php/commitdiff
Change the name of the second parameter of image writer functions
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 23 Jul 2016 13:36:49 +0000 (15:36 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 23 Jul 2016 13:38:54 +0000 (15:38 +0200)
As of PHP 5.4.0 the second parameter of all image writer functions (except
imagexbm) accepts also a stream resource. Therefore the parameter name
`filename` is inappropriate. We change it to `to` according to what it's
already called in _php_image_output_ctx().

We consider the reflection only related BC break acceptable for a minor version.

UPGRADING
ext/gd/gd.c

index 5400a2eee688581837ac91aa31bd9c1708ff747d..cdf8cfb48a9686459731bc16da99e7acb1945016 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -60,6 +60,10 @@ PHP 7.1 UPGRADE NOTES
     mt_srand() to produce a deterministic sequence, it can be called using
     mt_srand($seed, MT_RAND_PHP) to produce old the sequences.
 
+- GD:
+  . Reflection related: the name of the second parameter of the image writer
+    functions (e.g. imagepng()) has been changed from `filename` to `to`.
+
 - JSON:
   . The serialize_precision is used instead of precision when encoding double
     values.
index 119bc8fec480f26871a5a3241a1df3da10083238..e862644ca4e17aff22a22e8e40460b9cc4ac237e 100644 (file)
@@ -361,45 +361,45 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegif, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
 ZEND_END_ARG_INFO()
 
 #ifdef HAVE_GD_PNG
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepng, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
 ZEND_END_ARG_INFO()
 #endif
 
 #ifdef HAVE_GD_WEBP
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewebp, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
 ZEND_END_ARG_INFO()
 #endif
 
 #ifdef HAVE_GD_JPG
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagejpeg, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
        ZEND_ARG_INFO(0, quality)
 ZEND_END_ARG_INFO()
 #endif
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewbmp, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
        ZEND_ARG_INFO(0, foreground)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd2, 0, 0, 1)
        ZEND_ARG_INFO(0, im)
-       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, to)
        ZEND_ARG_INFO(0, chunk_size)
        ZEND_ARG_INFO(0, type)
 ZEND_END_ARG_INFO()
@@ -2674,7 +2674,7 @@ PHP_FUNCTION(imagexbm)
 }
 /* }}} */
 
-/* {{{ proto bool imagegif(resource im [, string filename])
+/* {{{ proto bool imagegif(resource im [, mixed to])
    Output GIF image to browser or file */
 PHP_FUNCTION(imagegif)
 {
@@ -2683,7 +2683,7 @@ PHP_FUNCTION(imagegif)
 /* }}} */
 
 #ifdef HAVE_GD_PNG
-/* {{{ proto bool imagepng(resource im [, string filename])
+/* {{{ proto bool imagepng(resource im [, mixed to])
    Output PNG image to browser or file */
 PHP_FUNCTION(imagepng)
 {
@@ -2694,7 +2694,7 @@ PHP_FUNCTION(imagepng)
 
 
 #ifdef HAVE_GD_WEBP
-/* {{{ proto bool imagewebp(resource im [, string filename[, int quality]] )
+/* {{{ proto bool imagewebp(resource im [, mixed to[, int quality]] )
    Output WEBP image to browser or file */
 PHP_FUNCTION(imagewebp)
 {
@@ -2705,7 +2705,7 @@ PHP_FUNCTION(imagewebp)
 
 
 #ifdef HAVE_GD_JPG
-/* {{{ proto bool imagejpeg(resource im [, string filename [, int quality]])
+/* {{{ proto bool imagejpeg(resource im [, mixed to [, int quality]])
    Output JPEG image to browser or file */
 PHP_FUNCTION(imagejpeg)
 {
@@ -2714,7 +2714,7 @@ PHP_FUNCTION(imagejpeg)
 /* }}} */
 #endif /* HAVE_GD_JPG */
 
-/* {{{ proto bool imagewbmp(resource im [, string filename [, int foreground]])
+/* {{{ proto bool imagewbmp(resource im [, mixed to [, int foreground]])
    Output WBMP image to browser or file */
 PHP_FUNCTION(imagewbmp)
 {
@@ -2722,7 +2722,7 @@ PHP_FUNCTION(imagewbmp)
 }
 /* }}} */
 
-/* {{{ proto bool imagegd(resource im [, string filename])
+/* {{{ proto bool imagegd(resource im [, mixed to])
    Output GD image to browser or file */
 PHP_FUNCTION(imagegd)
 {
@@ -2730,7 +2730,7 @@ PHP_FUNCTION(imagegd)
 }
 /* }}} */
 
-/* {{{ proto bool imagegd2(resource im [, string filename [, int chunk_size [, int type]]])
+/* {{{ proto bool imagegd2(resource im [, mixed to [, int chunk_size [, int type]]])
    Output GD2 image to browser or file */
 PHP_FUNCTION(imagegd2)
 {