protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

[PHP] - add support for PIE command

Open vencakrecl opened this issue 7 months ago • 6 comments

Description

There is a new way to install an extension for PHP via the pie command. It's a replacement for the old pecl command. It would be good to have support for it. See https://github.com/php/pie.

Additional context

see https://github.com/php/pie/blob/main/docs/extension-maintainers.md.

pie install google/ext-protobuf

The issue also exists for gRPC ext, see https://github.com/grpc/grpc/issues/38209

vencakrecl avatar May 17 '25 06:05 vencakrecl

I notice PIE is experimental at the moment:

Warning

PIE is still in early development. We welcome you to try this out, but please exercise caution when using PIE, as things may go wrong! If you do encounter issues, please do report an issue!

We probably wouldn't officially support this tool while it is still experimental. But I think we could accept a PR for best-effort support.

If I'm understanding correctly, this would mainly involve:

  1. Modifying composer.json.dist appropriately
  2. Copying the files for the PHP extension to the https://github.com/protocolbuffers/protobuf-php repo at release time. This would be a change to the script here: https://github.com/protocolbuffers/protobuf/blob/main/php/release.sh

haberman avatar Jun 06 '25 22:06 haberman

It's a pre-release version supported and maintained by The PHP Foundation, see https://thephp.foundation/blog/2024/11/19/pie-pre-release/. Many extensions already support PIE, see https://github.com/php/pie/blob/main/docs/supported-extensions.md or https://packagist.org/extensions.

The new composer.json must be added for the code written in C (PHP extension) https://github.com/protocolbuffers/protobuf/tree/main/php/ext/google/protobuf

vencakrecl avatar Jun 08 '25 14:06 vencakrecl

@haberman version 1.0.0 has been officially released https://github.com/php/pie/releases/tag/1.0.0

vencakrecl avatar Jun 17 '25 15:06 vencakrecl

@vencakrecl Could you maybe create the PR?

ruudk avatar Jul 28 '25 09:07 ruudk

There's some PRs going out in php-src to start removing PECL. If I open a PR adding a simple composer.json for the extension, will y'all manage https://github.com/php/pie/blob/main/docs/extension-maintainers.md#submit-the-extension-to-packagist?

SpencerMalone avatar Oct 13 '25 05:10 SpencerMalone