You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blueprints should support at least the following runtimes:
wp-cli
Docker
wp-now
Playground
Native PHP CLI
VS Code extension
Runtime-specific features
Caching the downloads
Blueprints shouldn't download the same 10MB WordPress.zip twice. Let's make sure we cache the downloads and invalidate the entries as new versions of Core and Plugins are released.
In native PHP CLI, we can cache in the filesystem, e.g. ~/.wp/. Ideally, this would take HTTP headers into consideration.
In Playground, we can rely on HTTP cache built into fetch(). In addition, we could cache at the service worker level.
In VS Code, there's a caching API AFAIR.
In Docker, we could use the docker build layers for caching.
Network calls
In native PHP CLI, we can use libcurl or fopen("https://")
In Playground, we can only rely on fetch(). We can't open raw TCP sockets so fopen("https://") and libcurl cannot be easily used.
In VS Code, we can open raw TCP sockets so fopen("https://"), but libcurl isn't since Playground doesn't support it yet.
Spawning child processes
Blueprint steps, wp-cli, phpunit, and other tools will often spawn child processes.
In wp-now PHP and native PHP, we can rely on proc_open
Blueprints should support at least the following runtimes:
Runtime-specific features
Caching the downloads
Blueprints shouldn't download the same 10MB WordPress.zip twice. Let's make sure we cache the downloads and invalidate the entries as new versions of Core and Plugins are released.
~/.wp/
. Ideally, this would take HTTP headers into consideration.fetch()
. In addition, we could cache at the service worker level.Network calls
libcurl
orfopen("https://")
fetch()
. We can't open raw TCP sockets sofopen("https://")
andlibcurl
cannot be easily used.fopen("https://")
, butlibcurl
isn't since Playground doesn't support it yet.Spawning child processes
Blueprint steps,
wp-cli
,phpunit
, and other tools will often spawn child processes.proc_open
Reporting progress
<div>
that needs to change itswidths
andinnerText
Filesystem interactions
I'd love to avoid abstract the filesystem and just use the regular PHP functions like
copy()
andfread()
Local mounts
It may useful to support mounting directories
Technical implementation
Dependency injection
Let's explore the dependency injection pattern. Pimple is a tiny service container we can use to plug-in runtime-specific implementations:
Other ideas
What are other viable solutions to this problem?
The text was updated successfully, but these errors were encountered: