3 ms·
Under PHP... > Msgpack is an PECL extension, thus you can simply install it by: Having something available in PECL is a good first step, but nobody will use i
by CiPHPerCoder 7y ago
Under PHP...
> Msgpack is an PECL extension, thus you can simply install it by:
Having something available in PECL is a good first step, but nobody will use it unless you either:
1. Get it into the standard library (which requires an RFC for PHP Internals), OR
2. Write a pure-PHP polyfill installable from Composer, OR
3. Do #2 then #1 (using the polyfill's popularity to argue for the importance of the RFC acceptance to make #1 a reality).
Reason: A lot of the places PHP is deployed, you can't compile C code or install binary dependencies (.so, .dll files). You can't access the OS package manager, either.
But Composer is a pure-PHP package manager that still operates in these environments.
So if anyone on HN ever wants your thing to be used by PHP developers, don't just stop at "PHP extension, written in C, available in PECL".
- snuxoll 7y ago> Reason: A lot of the places PHP is deployed, you can't compile C code or install binary dependencies (.so, .dll files). You can't access the OS package manager, either. If you’re in the target audience for msgpack you probably aren’t relying on shared hosting and can build a pecl extension.
- somehnguy 7y agoThats some strange logic. I have multiple racks of company owned bare metal that I deploy to. Still don't want to build a pecl extension. Much simpler and way less likely to not run into random build issues if I can just install via composer.
- snuxoll 7y ago> Still don't want to build a pecl extension. Docker? Build it as a system (RPM/DEB) package? Man, my life would be difficult if I just flat out refused to use packages for PHP/Python/Ruby requiring native extensions because it required some minimal effort on my part to deploy it.
- PetahNZ 7y agoIf you literally read further down the page there is a pure PHP implementation, the rybakit/msgpack composer module.