crazywhalecc / static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
https://static-php.dev
MIT License
1.34k stars 233 forks source link

replace ext-zend-opcache with ext-opcache for spc extension list #475

Closed DubbleClick closed 5 months ago

DubbleClick commented 5 months ago

This is useful because if your composer.json lists "ext-zend-opcache" (as "ext-opcache" is invalid) and use composer check-platform-reqs to select the appropriate extensions, spc will complain that the zend-opcache extension does not exist.

This would also affect the zend-guard and zend-debugger extensions, but they're severely outdated and/or not included in the free available php anyway.

DubbleClick commented 5 months ago

Example where this is used: https://github.com/dunglas/frankenphp/blob/main/build-static.sh#L27

crazywhalecc commented 5 months ago

Regarding the standardization of extension names, I think we can maintain a global constant to save them, and move these internal extensions into the constants. And opcache may also have Zend Opcache and zendopcache(old pecl version) name (plus case insensitive). WDYT?

DubbleClick commented 5 months ago

I agree, I thought about creating an "alias" section in ext.json but wasn't sure if it would be worth the effort with opcache being the only "common" extension that is in non-standard scheme in composer.

Would you like me to change up this PR to introduce an alias section? Or do you have another idea how to handle it?

crazywhalecc commented 5 months ago

I made it a constant, and filter it in parseExtensionList.