From 8fa1b899fc707bc119ab4810d03f713cebcf5af6 Mon Sep 17 00:00:00 2001 From: Heiko Mamerow Date: Wed, 12 Apr 2023 20:58:24 +0200 Subject: [PATCH] docs(readme): updated the description texts --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 881773e..a41af58 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,17 @@ ## Background -If you work with different docker environments at the same time you need to manage the ports. *wp-env* uses port 8888 by default. If this port is already in use by another project then you have a problem. But the solution is easy: Just change the ports. +If you are working with different Docker environments at the same time, you need to manage the ports. *wp-env* uses port 8888 by default. If this port is already used by another project, you have a problem. But the solution is simple: just change the ports. -*wp-env-port-stamp* generates every time a new port address - more or less - randomly. When the package is called, it creates a file *.wp-env.json* in the directory where it was called. With this *.wp-env.json* file you can customize the WordPress installation. In our case dynamic rendered port numbers. +*wp-env-port-stamp* generates a new port address - more or less - randomly. When the package is called, the following happens: -The port number will be generated from the current JavaScript date - the time in milliseconds since the ECMAScript epoch. We take the last 4 numbers of this time as the port number. This solution my not be perfekt but good enough for your daily local web development with a handful docker instances. :-) +* It checks if a file *.wp-env.json* exists in the executing directory. +* If so, only the two ports are set or changed. The other values remain untouched. +* If no, a new file is created. + +The port number is generated from the current JavaScript date - the time in milliseconds since the ECMAScript epoch. We take the last digits of this time as the port number. This number is somewhere between 1 and 65535. There is also a filter that prevents commonly used port numbers (e.g. 8888) from being used. + +My solution may not be perfect, but it is good enough for daily local web development with a handful of Docker instances :-) ## Install/Remove @@ -31,5 +37,3 @@ npm uninstall -g wp-env-port-stamp 3. The file is generated. You can start now with `wp-env` Normally you only need to call the package for the first time in a new project. Later just start directly *wp-env*. - -**Attention:** If there is already existing *.wp-env.json* file, *wp-env-port-stamp* will overwrite it! (There will be an improvement for this later.)