PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.5.9
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.5.9
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 / Providers / ClientProvider.php
hostinger-reach / src / Providers Last commit date
AmplitudeProvider.php 2 months ago AssetsProvider.php 11 months ago BlocksProvider.php 3 months ago ClientProvider.php 2 months ago ContainerProvider.php 11 months ago DatabaseProvider.php 8 months ago HostingRoutesProvider.php 2 months ago IntegrationsProvider.php 5 months ago JobsProvider.php 7 months ago MenusProvider.php 11 months ago NoticesProvider.php 4 months ago ProviderInterface.php 11 months ago RedirectsProvider.php 11 months ago RoutesProvider.php 9 months ago SurveysProvider.php 2 months ago TrackingProvider.php 8 months ago WebhooksProvider.php 8 months ago WpdbProvider.php 11 months ago
ClientProvider.php
37 lines
1 <?php
2
3 namespace Hostinger\Reach\Providers;
4
5 use Hostinger\Reach\Container;
6 use Hostinger\WpHelper\Config;
7 use Hostinger\WpHelper\Constants;
8 use Hostinger\WpHelper\Requests\Client;
9 use Hostinger\WpHelper\Utils as Helper;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 die;
13 }
14
15 class ClientProvider implements ProviderInterface {
16
17 public function register( Container $container ): void {
18 $container->set( Helper::class, fn() => new Helper() );
19 $container->set( Config::class, fn() => new Config() );
20 $container->set(
21 Client::class,
22 function () use ( $container ) {
23 return new Client(
24 $container->get( Config::class )->getConfigValue(
25 'base_rest_uri',
26 Constants::HOSTINGER_REST_URI
27 ),
28 array(
29 Config::TOKEN_HEADER => apply_filters( 'hostinger_api_token', $container->get( Helper::class )->getApiToken() ),
30 Config::DOMAIN_HEADER => apply_filters( 'hostinger_domain', $container->get( Helper::class )->getHostInfo() ),
31 )
32 );
33 }
34 );
35 }
36 }
37