vercel-community / php

🐘 PHP Runtime for ▲ Vercel Serverless Functions (support 7.4-8.3)
https://php.vercel.app
MIT License
1.27k stars 292 forks source link

accessing php as part of the build #54

Closed reed-jones closed 4 years ago

reed-jones commented 4 years ago

Question

As part of my build process I run npm run production which compiles all my javascript, however a step in my build executes a php script. This seems to fail on ZEIT since php doesn't appear to be available. Currently this means I need to pre-compile my assets and skip zeits build step.

Is there a way to expose php to my npm build scripts? or alternatively, is there a way to run my npm build scripts as part of the now-php build step?

f3l1x commented 4 years ago

Hi @reed-jones. Good point, I will allow to run php scripts. I was thinking about composer scripts, would it be a problem for you? I'd like to avoid combination of composer scripts and npm scripts.

reed-jones commented 4 years ago

@f3l1x a composer script would do just fine as long as I could still access node/npm somehow (e.g. calling it from the composer script). My build process is a little complicated, but I assume If I called a composer script, node/npm would be accessible in the environment too?

...Also, thanks for your work :)

f3l1x commented 4 years ago

I can't tell you the date, but I will work on it. :-)

f3l1x commented 4 years ago

This feature will be included in v0.3.0 (#81)

f3l1x commented 4 years ago

Implemented. See FAQ (https://github.com/juicyfx/vercel-php#%EF%B8%8F-faq)

reed-jones commented 4 years ago

Looks great, thank you!