protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

[php][ext] Supports PIE

Open qdequippe opened this issue 4 weeks ago • 3 comments

Supports The PHP Installer for Extensions (PIE)

https://github.com/php/pie/blob/1.4.x/docs/extension-maintainers.md

qdequippe avatar Dec 04 '25 14:12 qdequippe

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Dec 04 '25 14:12 google-cla[bot]

Please sign the CLA before we can review your PR.

zhangskz avatar Dec 05 '25 18:12 zhangskz

Does this impact the non-extension php library? The php/ directory publishes both a pure PHP composer library, and under php/ext/google/protobuf has the C extension. I would have expected us to have 2 separate composer projects to support the two separate artifacts.

SpencerMalone avatar Dec 09 '25 15:12 SpencerMalone

hello @zhangskz I signed the CLA

qdequippe avatar Dec 16 '25 15:12 qdequippe

Does this impact the non-extension php library? The php/ directory publishes both a pure PHP composer library, and under php/ext/google/protobuf has the C extension. I would have expected us to have 2 separate composer projects to support the two separate artifacts.

I don't think there is any impact on the existing php library but I will double check with the PIE's core contributors.

qdequippe avatar Dec 16 '25 15:12 qdequippe

Due to the way Packagist works, you can only have EITHER a PHP library, OR a PIE extension in a project's composer.json. This would therefore break the existing PHP library.

This has been brought up before: php/pie#261

The solution, as far as I can tell, is to have a separate repo for the PHP library and PIE extension components.

asgrim avatar Dec 16 '25 15:12 asgrim

Thanks @asgrim , that's a nonstarter for this PR then. We will take a look at some other options.

bshaffer avatar Dec 16 '25 15:12 bshaffer

Thanks @asgrim , that's a nonstarter for this PR then. We will take a look at some other options.

I just did some exploring, and was confused how the PHP library even works at the moment (since Packagist looks for the root composer.json, which doesn't exist in this repo); then I discovered it is actually split/mirrored: https://github.com/protocolbuffers/protobuf-php

You could potentially take a similar approach and split/mirror the subdirectory; https://github.com/protocolbuffers/protobuf/tree/main/php/ext/google/protobuf (which could have its own composer.json similar to what is proposed).

asgrim avatar Dec 16 '25 16:12 asgrim