PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.8.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.8.0
1.8.0 1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / src / Boot.php
hostinger-reach / src Last commit date
Admin 2 days ago Amplitude 3 months ago Api 2 days ago Blocks 2 days ago Dto 8 months ago Integrations 2 days ago Jobs 2 days ago Models 9 months ago Providers 2 days ago Repositories 9 months ago Setup 2 days ago Tracking 1 month ago Boot.php 3 months ago Container.php 1 year ago Functions.php 6 months ago
Boot.php
92 lines
1 <?php
2
3 namespace Hostinger\Reach;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 die;
7 }
8
9 use Hostinger\Reach\Providers\AmplitudeProvider;
10 use Hostinger\Reach\Providers\AssetsProvider;
11 use Hostinger\Reach\Providers\BlocksProvider;
12 use Hostinger\Reach\Providers\ClientProvider;
13 use Hostinger\Reach\Providers\ContainerProvider;
14 use Hostinger\Reach\Providers\DatabaseProvider;
15 use Hostinger\Reach\Providers\HostingRoutesProvider;
16 use Hostinger\Reach\Providers\IntegrationsProvider;
17 use Hostinger\Reach\Providers\JobsProvider;
18 use Hostinger\Reach\Providers\MenusProvider;
19 use Hostinger\Reach\Providers\NoticesProvider;
20 use Hostinger\Reach\Providers\ProviderInterface;
21 use Hostinger\Reach\Providers\RedirectsProvider;
22 use Hostinger\Reach\Providers\RoutesProvider;
23 use Hostinger\Reach\Providers\SurveysProvider;
24 use Hostinger\Reach\Providers\TrackingProvider;
25 use Hostinger\Reach\Providers\WebhooksProvider;
26 use Hostinger\Reach\Providers\WpdbProvider;
27
28 class Boot {
29 private Container $container;
30
31 private array $all_providers = array();
32
33 private array $providers = array(
34 WpdbProvider::class,
35 ContainerProvider::class,
36 DatabaseProvider::class,
37 AssetsProvider::class,
38 MenusProvider::class,
39 RoutesProvider::class,
40 BlocksProvider::class,
41 IntegrationsProvider::class,
42 RedirectsProvider::class,
43 WebhooksProvider::class,
44 TrackingProvider::class,
45 JobsProvider::class,
46 NoticesProvider::class,
47 );
48
49 private array $hostinger_providers = array(
50 ClientProvider::class,
51 SurveysProvider::class,
52 AmplitudeProvider::class,
53 HostingRoutesProvider::class,
54 );
55
56 private static ?Boot $instance = null;
57
58 private function __construct() {
59 $this->container = new Container();
60 }
61
62 public static function get_instance(): self {
63 if ( self::$instance === null ) {
64 self::$instance = new self();
65 }
66
67 return self::$instance;
68 }
69
70 public function plugins_loaded(): void {
71 $this->set_providers();
72 $this->register_providers();
73 }
74
75 public function set_providers(): void {
76 $this->all_providers = $this->providers;
77
78 if ( ! empty( $_SERVER['H_PLATFORM'] ) ) {
79 $this->all_providers = array_merge( $this->all_providers, $this->hostinger_providers );
80 }
81 }
82
83 private function register_providers(): void {
84 foreach ( $this->all_providers as $provider_class ) {
85 $provider = new $provider_class();
86 if ( $provider instanceof ProviderInterface ) {
87 $provider->register( $this->container );
88 }
89 }
90 }
91 }
92