Skip to content

Commit

Permalink
Merge pull request #547 from wp-cli/fix/early-require
Browse files Browse the repository at this point in the history
 Document `WP_CLI_EARLY_REQUIRE` environment variable
  • Loading branch information
mrsdizzie authored Nov 26, 2024
2 parents 3c0c59b + dc368c8 commit bee9829
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ WP-CLI's behavior can be changed at runtime through the use of environment varia
* `WP_CLI_STRICT_ARGS_MODE` - Avoid ambiguity by telling WP-CLI to treat any arguments before the command as global, and after the command as local.
* `WP_CLI_SUPPRESS_GLOBAL_PARAMS` - Set to `true` to skip showing the global parameters at the end of the help screen. This saves screen estate for advanced users.
* `WP_CLI_FORCE_USER_LOGIN` - Set to `1` to force the value provided to the `--user` flag to be interpreted as a login instead of an ID, to get around ambiguous types.
* `WP_CLI_EARLY_REQUIRE` - Load a custom PHP file early on in the bootstrap process.

To set an environment variable on demand, simply place the environment variable definition before the WP-CLI command you mean to run.

Expand Down
1 change: 1 addition & 0 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ If you want to run WP-CLI remotely using SSH, it is required that the command `w
* `WP_CLI_PHP_ARGS` – Arguments to pass to the PHP binary when invoking WP-CLI (only works for non-Phar installation).
* `WP_CLI_SSH_PRE_CMD` – When using `--ssh=<ssh>`, perform a command before WP-CLI calls WP-CLI on the remote server.
* `WP_CLI_STRICT_ARGS_MODE` – Avoid ambiguity by telling WP-CLI to treat any arguments before the command as global, and after the command as local.
* `WP_CLI_EARLY_REQUIRE` - Load a custom PHP file early on in the bootstrap process.

To set an environment variable on demand, you can place the environment variable definition before the WP-CLI command you mean to run (e.g. `EDITOR=vim wp post edit 1`); to overwrite environment variables, use `export VARIABLE=value` in your `~/.bashrc` or `~.zhsrc`.

Expand Down

0 comments on commit bee9829

Please sign in to comment.