johndwells / Minimee

Minimize & combine your CSS and JS files. Minify your HTML. Because size (still) DOES matter.
http://johndwells.github.com/Minimee
56 stars 16 forks source link

Failure parsing `memory_limit` PHP 7.1 #28

Closed msbit closed 7 years ago

msbit commented 7 years ago

If the format of memory_limit contains a unit character (M,K,G), CSSmin::normalize_int will try to multiply that string by the appropriate unit amount.

Under PHP 7.1, attempting to do so results in:

Notice: A non well formed numeric value encountered

which Craft considers sufficient to throw an exception and error out.

This doesn't cause an issue in previous versions of PHP:

$ php -v
PHP 5.5.38 (cli) (built: Jul  3 2017 15:16:35) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
$ php -r 'var_dump("1024M" * 1048576);'
int(1073741824)

$ php -v
PHP 5.6.31 (cli) (built: Aug 17 2017 11:33:10) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
$ php -r 'var_dump("1024M" * 1048576);'
int(1073741824)

$ php -v
PHP 7.0.22 (cli) (built: Aug 17 2017 11:29:35) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
$ php -r 'var_dump("1024M" * 1048576);'
int(1073741824)

$ php -v
PHP 7.1.8 (cli) (built: Aug 17 2017 11:34:56) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
$ php -r 'var_dump("1024M" * 1048576);'

Notice: A non well formed numeric value encountered in Command line code on line 1
int(1073741824)
msbit commented 7 years ago

This looks to be fixed in v3.0.0 of upstream https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port.

msbit commented 7 years ago

Never mind, wrong project, and duplicate of https://github.com/johndwells/craft.minimee/issues/28