| Server IP : 87.229.120.60 / Your IP : 216.73.216.245 Web Server : Apache System : Linux outside 5.4.8_Algonet_ZeroMAC_0.9.4.8 #6 SMP Mon Feb 3 20:36:07 CET 2020 x86_64 User : server ( 1002) PHP Version : 8.3.20 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/faktorteam/www/wp-content/plugins/wp-rocket/inc/ThirdParty/Hostings/ |
Upload File : |
<?php
namespace WP_Rocket\ThirdParty\Hostings;
/**
* Host Resolver.
*
* @since 3.6.3
*/
class HostResolver {
/**
* Name of the current host service.
*
* @var string
*/
private static $hostname = '';
/**
* Get the name of an identifiable hosting service.
*
* @since 3.6.3
*
* @param bool $ignore_cached_hostname (optional) Don't use cached hostname when true.
*
* @return string Name of the hosting service or '' if no service is recognized.
*/
public static function get_host_service( $ignore_cached_hostname = false ) {
if ( ! $ignore_cached_hostname && ! empty( self::$hostname ) ) {
return self::$hostname;
}
if ( isset( $_SERVER['cw_allowed_ip'] ) ) {
self::$hostname = 'cloudways';
return 'cloudways';
}
if ( rocket_get_constant( 'IS_PRESSABLE' ) ) {
self::$hostname = 'pressable';
return 'pressable';
}
if ( getenv( 'SPINUPWP_CACHE_PATH' ) ) {
self::$hostname = 'spinupwp';
return 'spinupwp';
}
if (
(
class_exists( 'WpeCommon' )
&&
function_exists( 'wpe_param' )
)
) {
self::$hostname = 'wpengine';
return 'wpengine';
}
if ( rocket_has_constant( 'O2SWITCH_VARNISH_PURGE_KEY' ) ) {
self::$hostname = 'o2switch';
return 'o2switch';
}
if ( rocket_get_constant( 'WPCOMSH_VERSION' ) ) {
self::$hostname = 'wordpresscom';
return 'wordpresscom';
}
if (
rocket_get_constant( '\Savvii\CacheFlusherPlugin::NAME_FLUSH_NOW' )
&&
rocket_get_constant( '\Savvii\CacheFlusherPlugin::NAME_DOMAINFLUSH_NOW' )
) {
return 'savvii';
}
if ( self::is_dreampress() ) {
return 'dreampress';
}
return '';
}
/**
* Checks if the current host is DreamPress
*
* @since 3.7.2
*
* @return boolean
*/
private static function is_dreampress() {
if ( ! isset( $_SERVER['DH_USER'] ) ) {
return false;
}
if (
! rocket_get_constant( 'WP_ROCKET_IS_TESTING', false )
&&
'dp-' !== substr( gethostname(), 0, 3 )
) {
return false;
}
return 'wp_' === substr( sanitize_key( wp_unslash( $_SERVER['DH_USER'] ) ), 0, 3 );
}
}