-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix: bref init on PHP8 #934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this, that's awesome!
Updated to duplicate instead of the symlinks |
I have been thinking about this and although I think it's great to fix the issue, I'm not so sure about the approach. Given that this is a basic initialization, I fail to see the usefulness of duplicating the entire folder e.g. the PHP files will very likely be the same throughout multiple versions because of how basic they are. I was wondering whether a simple search and replace on the serverless template could be a simpler solution? @mnapoli what do you think? |
You know what, I foresee this being a problem with PHP 8.1 indeed 🤔 And currently PHP 7.3 is still supported, so right now we would have the same problem with that version too. Replacing the version number would be a more scalable approach indeed 👍 Sorry @t-richard I made you duplicate those files. |
I agree, I will take a look at this later this week and see what I can come up with 🙂
PHP 7.3 would not be a problem because the 7.4 layer would be used and there should be no compatibility issue (nor composer error) when running PHP 7.3 code on PHP 7.4. Same for running 8.0 code on 8.1 |
@@ -17,5 +17,5 @@ functions: | |||
|
|||
# Exclude files from deployment | |||
package: | |||
exclude: | |||
- 'tests/**' | |||
pattern: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking into this change and it appears that pattern
is an invalid key. The correct key would be patterns
, perhaps?
Serverless: at 'package': unrecognized property 'pattern'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed 🤦
I'll look into this soon™️
Didn't had the time to work on this again and test it
I just sent #937 as an alternative solution using search/replace. |
Here is an idea to fix #933
ATM running
vendor/bin/bref init
with PHP8 will result in a composer errror when deployed on Lambdabecause the layer used by default is
74-fpm
Here I check for the php version and use that to determine which template should be used