PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.1
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.1
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 / vendor / hostinger / hostinger-wp-helper / src / Config.php
hostinger-reach / vendor / hostinger / hostinger-wp-helper / src Last commit date
Requests 1 month ago Config.php 1 month ago Constants.php 1 month ago Utils.php 1 month ago
Config.php
35 lines
1 <?php
2
3 namespace Hostinger\WpHelper;
4
5 defined('ABSPATH') || exit;
6
7 class Config
8 {
9 private array $config = array();
10 public const TOKEN_HEADER = 'X-Hpanel-Order-Token';
11 public const DOMAIN_HEADER = 'X-Hpanel-Domain';
12 public const CONFIG_PATH = ABSPATH . '.private/config.json';
13 public function __construct()
14 {
15 $this->decodeConfig(self::CONFIG_PATH);
16 }
17
18 private function decodeConfig(string $path): void
19 {
20 if (file_exists($path)) {
21 $config_content = file_get_contents($path);
22 $this->config = json_decode($config_content, true);
23 }
24 }
25
26 public function getConfigValue(string $key, $default): string
27 {
28 if ($this->config && isset($this->config[ $key ]) && ! empty($this->config[ $key ])) {
29 return $this->config[ $key ];
30 }
31
32 return $default;
33 }
34 }
35