From 0c74b5d8692b93e84f79d45e43467a2964a376a3 Mon Sep 17 00:00:00 2001 From: freezy Date: Wed, 7 Oct 2020 22:01:31 +0200 Subject: [PATCH] allow root from environment --- php/WP_CLI/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/WP_CLI/Runner.php b/php/WP_CLI/Runner.php index f16b0fb18a..2405c2c270 100644 --- a/php/WP_CLI/Runner.php +++ b/php/WP_CLI/Runner.php @@ -959,7 +959,7 @@ public function init_config() { } private function check_root() { - if ( $this->config['allow-root'] ) { + if ( $this->config['allow-root'] || getenv( 'WP_CLI_ALLOW_ROOT' ) ) { return; # they're aware of the risks! } if ( count( $this->arguments ) >= 2 && 'cli' === $this->arguments[0] && in_array( $this->arguments[1], array( 'update', 'info' ), true ) ) {