Skip to content

Latest commit

 

History

History
88 lines (55 loc) · 1.81 KB

README.md

File metadata and controls

88 lines (55 loc) · 1.81 KB

Garden Hot PHP

Question

How do we use Garden's live code syncing to see PHP code changes to running in cluster?

Why

So developers working on php-based services can use code syncing to see their changes running and test as they code.

Requires

  • Minikube or other local-kubernetes

Web App Example

It should

  • Run a php base web service
  • Load a php component passed by way of a command line argument

How

Create a php script that sets passed argments as environment varbiables, starts the dev server running the service.

Steps

  • create dev.php script
  • use dev.php in devMode command

Running Example

Test Plan

  • Clone repo
  • From repo root garden dev
  • Open ingress for hotphp service in browser
  • Edit app/component.php with small change
  • Refresh browser

Expected Result

Change made to component is visible when browser refreshed

CLI Example

It should

  • Run a php base cli
  • Output command line arguments

How

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.

Steps

  • create cli.php
  • create garden custom command to run it with garden exec

Running Example

Test Plan

  • Clone repo
  • From repo root garden dev
  • From repo root garden cli
  • Edit app/cli.php with small change
  • Run garden cli again

Expected Result

Change made to cli.php output is visible when cli command run again

See