Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for php extension packages #11795

Merged
merged 5 commits into from
Mar 20, 2024
Merged

Add support for php extension packages #11795

merged 5 commits into from
Mar 20, 2024

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jan 12, 2024

Basic infrastructure to let pie reuse Composer code for PHP extension packages.

res/composer-schema.json Outdated Show resolved Hide resolved
@stof
Copy link
Contributor

stof commented Jan 12, 2024

Also, should the ValidatingArrayLoader enforce that an extension package only defines links (requirements and conflicts) on platform packages ? It would not make any sense for an extension to depend on a userland package AFAICT.

res/composer-schema.json Outdated Show resolved Hide resolved
res/composer-schema.json Show resolved Hide resolved
@@ -6,7 +6,7 @@
"name": {
"type": "string",
"description": "Package name, including 'vendor-name/' prefix.",
"pattern": "^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$"
"pattern": "^([a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*|ext-[a-z0-9]([_.-]?[a-z0-9]+)*)$"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions have been raised about the naming here; so we should agree first on the best approach on ThePHPF/pie-design#8 before merging this IMO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have rolled back the ext- package naming changes for now, so IMO this would be mergeable as is as a first step. What do you think?

Copy link
Contributor

@asgrim asgrim Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this would be mergeable as is as a first step. What do you think?

Question: if someone adds a package which has a type php-ext/php-ext-zend to their project's composer.json, for example say we have xdebug/xdebug eventually, what will Composer do? will it download the source code into their vendor directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.. Not sure if we should prevent this or leave it as an exercise to the reader. I think I could pretty easily just ignore these packages in the solver and make them invisible to Composer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok done

@Seldaek Seldaek merged commit 07fa425 into composer:main Mar 20, 2024
18 of 20 checks passed
@Seldaek Seldaek deleted the php-ext branch March 20, 2024 21:05
asgrim added a commit to asgrim/example-pie-extension that referenced this pull request Mar 21, 2024
NOTE: the composer validate won't work until Composer 2.8 is released

see: composer/composer#11795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants