1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Copyright 2014 Brian Smith <[email protected]>. |
5
|
|
|
* |
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
7
|
|
|
* you may not use this file except in compliance with the License. |
8
|
|
|
* You may obtain a copy of the License at |
9
|
|
|
* |
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
11
|
|
|
* |
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
14
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15
|
|
|
* See the License for the specific language governing permissions and |
16
|
|
|
* limitations under the License. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace phparia\Resources; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Info about how Asterisk was built |
23
|
|
|
* |
24
|
|
|
* @author Brian Smith <[email protected]> |
25
|
|
|
*/ |
26
|
|
|
class BuildInfo extends Response |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* @var string Username that build Asterisk |
30
|
|
|
*/ |
31
|
|
|
private $user; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string Compile time options, or empty string if default. |
35
|
|
|
*/ |
36
|
|
|
private $options; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var string Machine architecture (x86_64, i686, ppc, etc.) |
40
|
|
|
*/ |
41
|
|
|
private $machine; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string OS Asterisk was built on. |
45
|
|
|
*/ |
46
|
|
|
private $os; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string Kernel version Asterisk was built on. |
50
|
|
|
*/ |
51
|
|
|
private $kernel; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var string Date and time when Asterisk was built. |
55
|
|
|
*/ |
56
|
|
|
private $date; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return string Username that build Asterisk |
60
|
|
|
*/ |
61
|
|
|
public function getUser() |
62
|
|
|
{ |
63
|
|
|
return $this->user; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return string Compile time options, or empty string if default. |
68
|
|
|
*/ |
69
|
|
|
public function getOptions() |
70
|
|
|
{ |
71
|
|
|
return $this->options; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return string Machine architecture (x86_64, i686, ppc, etc.) |
76
|
|
|
*/ |
77
|
|
|
public function getMachine() |
78
|
|
|
{ |
79
|
|
|
return $this->machine; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return string OS Asterisk was built on. |
84
|
|
|
*/ |
85
|
|
|
public function getOs() |
86
|
|
|
{ |
87
|
|
|
return $this->os; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return string Kernel version Asterisk was built on. |
92
|
|
|
*/ |
93
|
|
|
public function getKernel() |
94
|
|
|
{ |
95
|
|
|
return $this->kernel; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return string Date and time when Asterisk was built. |
100
|
|
|
*/ |
101
|
|
|
public function getDate() |
102
|
|
|
{ |
103
|
|
|
return $this->date; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param string $response |
108
|
|
|
*/ |
109
|
|
|
public function __construct($response) |
110
|
|
|
{ |
111
|
|
|
parent::__construct($response); |
112
|
|
|
|
113
|
|
|
$this->user = $this->getResponseValue('user'); |
114
|
|
|
$this->options = $this->getResponseValue('options'); |
115
|
|
|
$this->machine = $this->getResponseValue('machine'); |
116
|
|
|
$this->os = $this->getResponseValue('os'); |
117
|
|
|
$this->kernel = $this->getResponseValue('kernel'); |
118
|
|
|
$this->date = $this->getResponseValue('date'); |
119
|
|
|
} |
120
|
|
|
} |
121
|
|
|
|