Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -93,4 +93,30 @@ class Host {
$domains[] = 'calypso.localhost';
return $domains;
}
/**
* Return Calypso environment value; used for developing Jetpack and pairing
* it with different Calypso environments, such as localhost.
*
* @since 1.18.0
*
* @return string Calypso environment
*/
public function get_calypso_env() {
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Nonce is not required; only used for changing environments.
if ( isset( $_GET['calypso_env'] ) ) {
return sanitize_key( $_GET['calypso_env'] );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
if ( getenv( 'CALYPSO_ENV' ) ) {
return sanitize_key( getenv( 'CALYPSO_ENV' ) );
}
if ( defined( 'CALYPSO_ENV' ) && CALYPSO_ENV ) {
return sanitize_key( CALYPSO_ENV );
}
return '';
}
}

View File

@@ -8,6 +8,7 @@
namespace Automattic\Jetpack;
use Automattic\Jetpack\Constants as Constants;
use Automattic\Jetpack\Current_Plan as Jetpack_Plan;
use Automattic\Jetpack\IP\Utils as IP_Utils;
/**
@@ -441,7 +442,7 @@ class Modules {
}
}
if ( class_exists( 'Jetpack_Plan' ) && ! \Jetpack_Plan::supports( $module ) ) {
if ( ! Jetpack_Plan::supports( $module ) ) {
return false;
}

View File

@@ -409,4 +409,5 @@ class Status {
return rtrim( $url, ':' );
}
}