1 | <?php |
||
12 | class NativeShare extends AbstractShare { |
||
13 | /** |
||
14 | * @var Server $server |
||
15 | */ |
||
16 | private $server; |
||
17 | |||
18 | /** |
||
19 | * @var string $name |
||
20 | */ |
||
21 | private $name; |
||
22 | |||
23 | /** |
||
24 | * @var \Icewind\SMB\NativeState $state |
||
25 | */ |
||
26 | private $state; |
||
27 | |||
28 | /** |
||
29 | * @param Server $server |
||
30 | * @param string $name |
||
31 | */ |
||
32 | public function __construct($server, $name) { |
||
38 | |||
39 | /** |
||
40 | * @throws \Icewind\SMB\Exception\ConnectionException |
||
41 | * @throws \Icewind\SMB\Exception\AuthenticationException |
||
42 | * @throws \Icewind\SMB\Exception\InvalidHostException |
||
43 | */ |
||
44 | protected function connect() { |
||
51 | |||
52 | /** |
||
53 | * Get the name of the share |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getName() { |
||
60 | |||
61 | private function buildUrl($path) { |
||
71 | |||
72 | /** |
||
73 | * List the content of a remote folder |
||
74 | * |
||
75 | * @param string $path |
||
76 | * @return \Icewind\SMB\IFileInfo[] |
||
77 | * |
||
78 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
79 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
80 | */ |
||
81 | public function dir($path) { |
||
96 | |||
97 | /** |
||
98 | * @param string $path |
||
99 | * @return \Icewind\SMB\IFileInfo[] |
||
100 | */ |
||
101 | public function stat($path) { |
||
104 | |||
105 | public function getStat($path) { |
||
109 | |||
110 | /** |
||
111 | * Create a folder on the share |
||
112 | * |
||
113 | * @param string $path |
||
114 | * @return bool |
||
115 | * |
||
116 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
117 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
118 | */ |
||
119 | public function mkdir($path) { |
||
123 | |||
124 | /** |
||
125 | * Remove a folder on the share |
||
126 | * |
||
127 | * @param string $path |
||
128 | * @return bool |
||
129 | * |
||
130 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
131 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
132 | */ |
||
133 | public function rmdir($path) { |
||
137 | |||
138 | /** |
||
139 | * Delete a file on the share |
||
140 | * |
||
141 | * @param string $path |
||
142 | * @return bool |
||
143 | * |
||
144 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
145 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
146 | */ |
||
147 | public function del($path) { |
||
151 | |||
152 | /** |
||
153 | * Rename a remote file |
||
154 | * |
||
155 | * @param string $from |
||
156 | * @param string $to |
||
157 | * @return bool |
||
158 | * |
||
159 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
160 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
161 | */ |
||
162 | public function rename($from, $to) { |
||
166 | |||
167 | /** |
||
168 | * Upload a local file |
||
169 | * |
||
170 | * @param string $source local file |
||
171 | * @param string $target remove file |
||
172 | * @return bool |
||
173 | * |
||
174 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
175 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
176 | */ |
||
177 | public function put($source, $target) { |
||
188 | |||
189 | /** |
||
190 | * Download a remote file |
||
191 | * |
||
192 | * @param string $source remove file |
||
193 | * @param string $target local file |
||
194 | * @return bool |
||
195 | * |
||
196 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
197 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
198 | * @throws \Icewind\SMB\Exception\InvalidResourceException |
||
199 | */ |
||
200 | public function get($source, $target) { |
||
225 | |||
226 | /** |
||
227 | * Open a readable stream top a remote file |
||
228 | * |
||
229 | * @param string $source |
||
230 | * @return resource a read only stream with the contents of the remote file |
||
231 | * |
||
232 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
233 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
234 | */ |
||
235 | public function read($source) { |
||
240 | |||
241 | /** |
||
242 | * Open a readable stream top a remote file |
||
243 | * |
||
244 | * @param string $source |
||
245 | * @return resource a read only stream with the contents of the remote file |
||
246 | * |
||
247 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
248 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
249 | */ |
||
250 | public function write($source) { |
||
255 | |||
256 | /** |
||
257 | * Get extended attributes for the path |
||
258 | * |
||
259 | * @param string $path |
||
260 | * @param string $attribute attribute to get the info |
||
261 | * @return string the attribute value |
||
262 | */ |
||
263 | public function getAttribute($path, $attribute) { |
||
269 | |||
270 | /** |
||
271 | * Get extended attributes for the path |
||
272 | * |
||
273 | * @param string $path |
||
274 | * @param string $attribute attribute to get the info |
||
275 | * @param mixed $value |
||
276 | * @return string the attribute value |
||
277 | */ |
||
278 | public function setAttribute($path, $attribute, $value) { |
||
287 | |||
288 | /** |
||
289 | * @param string $path |
||
290 | * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL |
||
291 | * @return mixed |
||
292 | */ |
||
293 | public function setMode($path, $mode) { |
||
296 | |||
297 | public function __destruct() { |
||
300 | } |
||
301 |