What to do with bundled GD's version info?

  101744
February 2, 2018 22:45 cmbecker69@gmx.de ("Christoph M. Becker")
Hi everybody!

Please consider the following script:

  
    
  101765
February 5, 2018 02:35 ajf@ajf.me (Andrea Faulds)
Hi Christoph,

Christoph M. Becker wrote:
> So the question is how to handle the version information of the bundled > libgd for the time being. With regard to gd_info()['GD Version'] just > saying "bundled" (without any compatibility statement) might be a good > solution. However, I'm at a loss how to handle GD_*_VERSION. Any ideas?
This might be a bit… maverick, but I wonder if we could get away with a semi-numeric string constant. The string "2-phpbundled" would compare greater than or equal to 2: $ php -r 'var_dump("2-phpbundled" == 2);' bool(true) $ php -r 'var_dump("2-phpbundled" >= 2);' bool(true) The problem is that, well, some code out there might want an actual integer. It's also a bit ugly… Thanks. -- Andrea Faulds https://ajf.me/
  101785
February 6, 2018 18:32 cmbecker69@gmx.de ("Christoph M. Becker")
Hi Andrea!

On 05.02.2018 at 03:35, Andrea Faulds wrote:

> Christoph M. Becker wrote: > >> So the question is how to handle the version information of the bundled >> libgd for the time being.   With regard to gd_info()['GD Version'] just >> saying "bundled" (without any compatibility statement) might be a good >> solution.  However, I'm at a loss how to handle GD_*_VERSION.  Any ideas? > > This might be a bit… maverick, but I wonder if we could get away with a > semi-numeric string constant. The string "2-phpbundled" would compare > greater than or equal to 2: > > $ php -r 'var_dump("2-phpbundled" == 2);' > bool(true) > $ php -r 'var_dump("2-phpbundled" >= 2);' > bool(true) > > The problem is that, well, some code out there might want an actual > integer. It's also a bit ugly…
Thanks! I don't think this would be helpful, though, since GD 2.0 has been released around the millenium, and GD 2.0.1 has already been bundled with PHP since at least PHP 4.3.0. Therefore we can safely assume that nobody uses GD 1 anymore. After reconsideration, it seems to me that we simply can drop the GD_*_VERSION constants for the bundled libgd. Anybody who would using them in combination with the bundled GD is likely to have buggy code, anyway. The only sensible thing to do currently would be to check for `GD_BUNDLED` and to check the PHP version. I've submitted a respective PR: <https://github.com/php/php-src/pull/3080>. -- Christoph M. Becker