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 proper provides rules for mbstring and iconv polyfills #54

Closed
wants to merge 1 commit into from

Conversation

stof
Copy link
Member

@stof stof commented May 10, 2016

Once composer/composer#5030 is resolved, this will allow to install symfony/polyfill-mbstring in a project and having it fulfill a ext-mbstring requirement set by another library not aware of the polyfill.
Without the bug fix, things work already when installing the polyfill from a VCS repo rather than from Packagist or when the polyfill was already installed locally (the bug is on Packagist side when loading metadata).
This would avoid having to do things like beberlei/assert#149 which forces any project using the library to install the polyfill even if they expect to always run with ext-mbstring available (the library could just continue to require ext-mbstring and projects may then choose to require the polyfill to fulfill the dependency)

@stof
Copy link
Member Author

stof commented May 10, 2016

note that I used 7 as version for the provided extension, because polyfill are compatible with the PHP 7 version of extensions. A better provide rule would be to give the version number of the extension itself, but core PHP extensions don't have a proper version number (which is why composer recommends to require * for them as the actual version being detected for them is not useful and may even depend on the way the extension was compiled AFAIK) and so I simply needed to specify a version number here.

@stof
Copy link
Member Author

stof commented May 10, 2016

@nicolas-grekas the test failure here does not look related to my change

@gerryvdm
Copy link

I believe a package promising to provide some functionality, should really provide all expected functionality. The mbstring polyfill for example does not provide an expected level of compatibility in my opinion, given only UTF-8 is supported.

@keradus
Copy link
Member

keradus commented Feb 22, 2017

@gerryvdm , native mbstring could provide different encodings, you should always check it via mb_list_encodings. for that, the polyfill provide only one of them (utf-8), which is fine.

@nicolas-grekas
Copy link
Member

I'm closing here as nothing changed on Composer's side in more than one year. Let's reopen when it'll be possible.

@DvdGiessen
Copy link

With the recent release of Composer 2.0, this is now possible! See also composer/composer#5030 (comment).

@stof
Copy link
Member Author

stof commented Nov 3, 2020

That's a good news, but we'll probably wait a bit for it to be adopted over Composer 1 to avoid issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants