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

Check meta-data deserialization capabilities in PHP 8 #64

Closed
ohader opened this issue Aug 5, 2020 · 3 comments
Closed

Check meta-data deserialization capabilities in PHP 8 #64

ohader opened this issue Aug 5, 2020 · 3 comments

Comments

@ohader
Copy link
Member

ohader commented Aug 5, 2020

Also, change the signature from getMetadata()
to getMetadata(array $unserialize_options = []).
Start throwing earlier if setMetadata() is called and serialization threw.

Scope for this package, craft a bunch of exploits for PHP 8 and see whether it works.
In case it does, this package probably could "hand over" Phar handling to native PHP 8 then...

@andypost
Copy link

andypost commented Oct 3, 2020

Other option is using class aliases for different versions of PHP(

@alexpott
Copy link
Contributor

Given that this library is not responsible for registering itself as a stream wrapper I think it's up to the calling code to decide what to do for PHP 8 - i.e. to not register the wrapper. If we want projects to be able to be both PHP 7 and PHP 8 compatible with the same code base then we need to allow this to be in a composer.json for a project that supports both of them.

#65 does to quickish thing of allowing install on PHP 8.0. The other option would be to release a new release which has the same API but does nothing other than passthrough to the PHP streamwrapper. But I think it's better for projects like Drupal to only register the wrapper when running on PHP 7.

ohader added a commit to ohader/phar-stream-wrapper that referenced this issue Nov 13, 2020
@ohader
Copy link
Member Author

ohader commented Sep 16, 2021

Referenced commit adds basic check against meta-data deserialization in PHP 8.x. I agree that this library should not add more magic on checking PHP versions - enabling or disabling Phar stream wrapper has do be done individually by corresponding projects and integrations.

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

No branches or pull requests

3 participants