1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2018 Robin Appelman <[email protected]> |
4
|
|
|
* |
5
|
|
|
* @license GNU AGPL version 3 or any later version |
6
|
|
|
* |
7
|
|
|
* This program is free software: you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU Affero General Public License as |
9
|
|
|
* published by the Free Software Foundation, either version 3 of the |
10
|
|
|
* License, or (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* This program is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU Affero General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU Affero General Public License |
18
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
19
|
|
|
* |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
namespace Icewind\SMB; |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
abstract class AbstractServer implements IServer { |
26
|
|
|
const LOCALE = 'en_US.UTF-8'; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string $host |
30
|
|
|
*/ |
31
|
|
|
protected $host; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var IAuth $user |
35
|
|
|
*/ |
36
|
|
|
protected $auth; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var \Icewind\SMB\System |
40
|
|
|
*/ |
41
|
|
|
protected $system; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var TimeZoneProvider |
45
|
|
|
*/ |
46
|
|
|
protected $timezoneProvider; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param string $host |
50
|
|
|
* @param IAuth $auth |
51
|
|
|
* @param System $system |
52
|
|
|
* @param TimeZoneProvider $timeZoneProvider |
53
|
|
|
*/ |
54
|
|
|
public function __construct($host, IAuth $auth, System $system, TimeZoneProvider $timeZoneProvider) { |
55
|
|
|
$this->host = $host; |
56
|
|
|
$this->auth = $auth; |
57
|
|
|
$this->system = $system; |
58
|
|
|
$this->timezoneProvider = $timeZoneProvider; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @return IAuth |
63
|
|
|
*/ |
64
|
|
|
public function getAuth() { |
65
|
|
|
return $this->auth; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* return string |
70
|
|
|
*/ |
71
|
|
|
public function getHost() { |
72
|
|
|
return $this->host; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return string |
77
|
|
|
*/ |
78
|
|
|
public function getTimeZone() { |
79
|
|
|
return $this->timezoneProvider->get(); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getSystem() { |
83
|
|
|
return $this->system; |
84
|
|
|
} |
85
|
|
|
} |
86
|
|
|
|