Skip to content

garden example with php in dev mode using php built in webserver

Notifications You must be signed in to change notification settings

dmytri/garden-hotphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

garden example with php in dev mode using php built in webserver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published