-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathQueueMetadataMessage.php
More file actions
86 lines (75 loc) · 1.67 KB
/
Copy pathQueueMetadataMessage.php
File metadata and controls
86 lines (75 loc) · 1.67 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
namespace SplitIO\Sdk;
class QueueMetadataMessage
{
private $sdkVersion;
private $machineIP;
private $machineName;
/**
* QueueMetadataMessage constructor.
*/
public function __construct($IPAddressesEnabled = true)
{
$this->sdkVersion = 'php-' . \SplitIO\version();
$this->machineIP = 'NA';
$this->machineName = 'NA';
if ($IPAddressesEnabled) {
$this->machineIP = \SplitIO\getHostIpAddress();
if ($this->machineIP != 'unknown') {
$this->machineName = 'ip-' . str_replace('.', '-', $this->machineIP);
} else {
$this->machineName = 'unknown';
}
}
}
/**
* @return mixed
*/
public function getSdkVersion()
{
return $this->sdkVersion;
}
/**
* @param mixed $sdkVersion
*/
public function setSdkVersion($sdkVersion)
{
$this->sdkVersion = $sdkVersion;
}
/**
* @return mixed
*/
public function getMachineIP()
{
return $this->machineIP;
}
/**
* @param mixed $machineIP
*/
public function setMachineIP($machineIP)
{
$this->machineIP = $machineIP;
}
/**
* @return mixed
*/
public function getMachineName()
{
return $this->machineName;
}
/**
* @param mixed $machineName
*/
public function setMachineName($machineName)
{
$this->machineName = $machineName;
}
public function toArray()
{
return array(
's' => $this->sdkVersion,
'i' => $this->machineIP,
'n' => $this->machineName
);
}
}