HostSubscriberFactory.php
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace WP_Rocket\ThirdParty\Hostings;
use WP_Rocket\Event_Management\Subscriber_Interface;
use WP_Rocket\ThirdParty\NullSubscriber;
use WP_Rocket\ThirdParty\SubscriberFactoryInterface;
/**
* Host Subscriber Factory
*
* @since 3.6.3
*/
class HostSubscriberFactory implements SubscriberFactoryInterface {
/**
* Get a Subscriber Interface object.
*
* @since 3.6.3
*
* @return Subscriber_Interface A Subscribe Interface for the current host.
*/
public function get_subscriber() {
$host_service = HostResolver::get_host_service( rocket_get_constant( 'WP_ROCKET_IS_TESTING', false ) );
switch ( $host_service ) {
case 'pressable':
return new Pressable();
case 'cloudways':
return new Cloudways();
case 'spinupwp':
return new SpinUpWP();
case 'wpengine':
return new WPEngine();
case 'o2switch':
return new O2Switch();
case 'wordpresscom':
return new WordPressCom();
case 'savvii':
return new Savvii();
case 'dreampress':
return new Dreampress();
case 'wpxcloud':
return new WPXCloud();
case 'litespeed':
return new LiteSpeed();
case 'godaddy':
return new Godaddy();
case 'kinsta':
return new Kinsta();
default:
return new NullSubscriber();
}
}
}