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

Fix: bref init on PHP8 #934

Merged
merged 2 commits into from
May 24, 2021
Merged

Fix: bref init on PHP8 #934

merged 2 commits into from
May 24, 2021

Conversation

t-richard
Copy link
Member

Here is an idea to fix #933

ATM running vendor/bin/bref init with PHP8 will result in a composer errror when deployed on Lambda
because 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

Copy link
Member

@mnapoli mnapoli left a 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!

@t-richard
Copy link
Member Author

Updated to duplicate instead of the symlinks

@deleugpn
Copy link
Member

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?

@mnapoli
Copy link
Member

mnapoli commented May 17, 2021

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.

@t-richard
Copy link
Member Author

I agree, I will take a look at this later this week and see what I can come up with 🙂

And currently PHP 7.3 is still supported, so right now we would have the same problem with that version too.

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:
Copy link
Member

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'

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 indeed 🤦
I'll look into this soon™️

Didn't had the time to work on this again and test it

@deleugpn
Copy link
Member

I just sent #937 as an alternative solution using search/replace.

@deleugpn deleugpn merged commit 7c39fde into brefphp:master May 24, 2021
@deleugpn deleugpn added the sls label Aug 6, 2021
@t-richard t-richard deleted the fix-init-php8 branch January 24, 2022 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants