Skip to content

Commit

Permalink
Merge pull request #2042 from Automattic/bnu-container-type-env-vars
Browse files Browse the repository at this point in the history
Add environment variable-based container-type detection
  • Loading branch information
nickdaugherty authored Mar 25, 2021
2 parents 1fcc279 + f409613 commit 4f91cc9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 000-vip-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
require __DIR__ . '/.secrets/vip-secrets.php';
}

require_once __DIR__ . '/lib/environment/class-environment.php';

if ( ! defined( 'A8C_PROXIED_REQUEST' ) ) {
/**
* @var constant A8C_PROXIED_REQUEST Set to true if the current request is made via the Automattic proxy, which is only available to Automatticians.
Expand All @@ -76,8 +78,8 @@
define( 'WPCOM_IS_VIP_ENV', false );
}

define( 'WPCOM_SANDBOXED', false !== strpos( gethostname(), '_web_dev_' ) );
define( 'VIP_GO_IS_CLI_CONTAINER', false !== strpos( gethostname(), '_wpcli_' ) || false !== strpos( gethostname(), '_wp_cli_' ) );
define( 'WPCOM_SANDBOXED', \Automattic\VIP\Environment::is_sandbox_container( gethostname(), $_ENV ) );
define( 'VIP_GO_IS_CLI_CONTAINER', \Automattic\VIP\Environment::is_batch_container( gethostname(), $_ENV ) );

// Used to verify emails sent via our SMTP servers
if ( ! defined( 'WPCOM_VIP_MAIL_TRACKING_KEY' ) ) {
Expand Down

0 comments on commit 4f91cc9

Please sign in to comment.