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

Proposal: Add support for PHP #55

Closed
itscaro opened this issue Aug 27, 2017 · 9 comments
Closed

Proposal: Add support for PHP #55

itscaro opened this issue Aug 27, 2017 · 9 comments
Labels

Comments

@itscaro
Copy link
Contributor

itscaro commented Aug 27, 2017

Expected Behaviour

Add template for PHP in order to support built-in build for PHP

Your Environment

Docker Version: 17.06.1-ce
Go version: go1.8.3
OS/Arch: linux/amd64

@alexellis
Copy link
Member

alexellis commented Aug 27, 2017

Hi @itscaro thanks for trying OpenFaaS.

The idea behind opening an issue is for discussion more than process. I had a few questions.

Is PHP a language you are going to need to work with? I ask because each new language added as an official template needs consideration as we'll have to support it in the project.

Core supported version

I also wonder what PHP version people are most likely to need?

Dependency management

Within Node, CSharp, Python and Ruby we have a way of specifying and managing additional dependencies. This seems like a core use-case for templates - i.e. adding a Gem or pip module.

Have you thought about how to express and manage dependencies for the PHP template?

I googled and found Composer popped up (I'm not a PHP expert)

@alexellis alexellis changed the title Add support for PHP Proposal: Add support for PHP Aug 27, 2017
@itscaro
Copy link
Contributor Author

itscaro commented Aug 27, 2017

Is PHP a language you are going to need to work with?: I work mostly with PHP and Go.

Core supported version: I think PHP 7 is ok for faas. Older versions of PHP are still widely used, but for new developments in my environment we opt for latest version of PHP (7.x)

Dependency management: It's Composer for PHP libraries, there are also extensions which need to be compiled and added through building steps in docker. In some cases, PHP libraries depend on PHP extensions, in this case it maybe better to build the image with Dockerfile instead.
I thought of implementing composer too, but I started with a simpler template.

@alexellis
Copy link
Member

Thanks for the info. I think the most basic template needs to have dependency management to follow the style and experience of the project.

@itscaro
Copy link
Contributor Author

itscaro commented Aug 28, 2017

I've just updated the template. Composer is used to handle PHP-library dependencies. PHP extensions which need to be compiled can be added through php-extensions.sh which is a shell file called by Docker build.

I will add a sample function to illustrate how to use.

@alexellis
Copy link
Member

Please can you raise a PR with a table of community templates starting with yours?

I'll merge after #201

Language Author URL
PHP @itscaro https://github.com/itscaro/openfaas-template-php/
PHP5 @itscaro https://github.com/itscaro/openfaas-template-php/

@johnmccabe 👍 👎 ?

@johnmccabe
Copy link
Contributor

Big 👍

@alexellis
Copy link
Member

Awesome. Let's do it then.

@withinboredom
Copy link

I was just wondering about this! Huge thanks to @itscaro for getting this together! 👍

@alexellis
Copy link
Member

This is moving over to #220 #201

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

No branches or pull requests

4 participants