How do we use Garden's live code syncing to see PHP code changes to running in cluster?
So developers working on php-based services can use code syncing to see their changes running and test as they code.
- Minikube or other local-kubernetes
- Run a php base web service
- Load a php component passed by way of a command line argument
Create a php script that sets passed argments as environment varbiables, starts the dev server running the service.
- create dev.php script
- use dev.php in devMode command
- Clone repo
- From repo root
garden dev
- Open ingress for hotphp service in browser
- Edit
app/component.php
with small change - Refresh browser
Change made to component is visible when browser refreshed
- Run a php base cli
- Output command line arguments
Create a php cli script that displaces arguments passed from the command line, and a garden custom command to execute it in cluster with garden exec.
- create cli.php
- create garden custom command to run it with garden exec
- Clone repo
- From repo root
garden dev
- From repo root
garden cli
- Edit
app/cli.php
with small change - Run
garden cli
again
Change made to cli.php output is visible when cli command run again