From: Christoph M. Becker Date: Sat, 23 Jul 2016 13:36:49 +0000 (+0200) Subject: Change the name of the second parameter of image writer functions X-Git-Tag: php-7.2.0alpha1~1339^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f294a82ccbc1e55645593edb20e67821ebe2bf44;p=php Change the name of the second parameter of image writer functions 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. --- diff --git a/UPGRADING b/UPGRADING index 5400a2eee6..cdf8cfb48a 100644 --- 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. diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 119bc8fec4..e862644ca4 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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) {