1 | <?php |
||
13 | class NativeShare extends AbstractShare { |
||
14 | /** |
||
15 | * @var Server $server |
||
16 | */ |
||
17 | private $server; |
||
18 | |||
19 | /** |
||
20 | * @var string $name |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * @var \Icewind\SMB\NativeState $state |
||
26 | */ |
||
27 | private $state; |
||
28 | |||
29 | /** |
||
30 | * @param Server $server |
||
31 | * @param string $name |
||
32 | */ |
||
33 | public function __construct($server, $name) { |
||
39 | |||
40 | /** |
||
41 | * @throws \Icewind\SMB\Exception\ConnectionException |
||
42 | * @throws \Icewind\SMB\Exception\AuthenticationException |
||
43 | * @throws \Icewind\SMB\Exception\InvalidHostException |
||
44 | */ |
||
45 | protected function connect() { |
||
52 | |||
53 | /** |
||
54 | * Get the name of the share |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getName() { |
||
61 | |||
62 | private function buildUrl($path) { |
||
72 | |||
73 | /** |
||
74 | * List the content of a remote folder |
||
75 | * |
||
76 | * @param string $path |
||
77 | * @return \Icewind\SMB\IFileInfo[] |
||
78 | * |
||
79 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
80 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
81 | */ |
||
82 | public function dir($path) { |
||
97 | |||
98 | /** |
||
99 | * @param string $path |
||
100 | * @return \Icewind\SMB\IFileInfo[] |
||
101 | */ |
||
102 | public function stat($path) { |
||
105 | |||
106 | public function getStat($path) { |
||
110 | |||
111 | /** |
||
112 | * Create a folder on the share |
||
113 | * |
||
114 | * @param string $path |
||
115 | * @return bool |
||
116 | * |
||
117 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
118 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
119 | */ |
||
120 | public function mkdir($path) { |
||
124 | |||
125 | /** |
||
126 | * Remove a folder on the share |
||
127 | * |
||
128 | * @param string $path |
||
129 | * @return bool |
||
130 | * |
||
131 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
132 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
133 | */ |
||
134 | public function rmdir($path) { |
||
138 | |||
139 | /** |
||
140 | * Delete a file on the share |
||
141 | * |
||
142 | * @param string $path |
||
143 | * @return bool |
||
144 | * |
||
145 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
146 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
147 | */ |
||
148 | public function del($path) { |
||
152 | |||
153 | /** |
||
154 | * Rename a remote file |
||
155 | * |
||
156 | * @param string $from |
||
157 | * @param string $to |
||
158 | * @return bool |
||
159 | * |
||
160 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
161 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
162 | */ |
||
163 | public function rename($from, $to) { |
||
167 | |||
168 | /** |
||
169 | * Upload a local file |
||
170 | * |
||
171 | * @param string $source local file |
||
172 | * @param string $target remove file |
||
173 | * @return bool |
||
174 | * |
||
175 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
176 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
177 | */ |
||
178 | public function put($source, $target) { |
||
189 | |||
190 | /** |
||
191 | * Download a remote file |
||
192 | * |
||
193 | * @param string $source remove file |
||
194 | * @param string $target local file |
||
195 | * @return bool |
||
196 | * |
||
197 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
198 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
199 | * @throws \Icewind\SMB\Exception\InvalidPathException |
||
200 | * @throws \Icewind\SMB\Exception\InvalidResourceException |
||
201 | */ |
||
202 | public function get($source, $target) { |
||
230 | |||
231 | /** |
||
232 | * Open a readable stream top a remote file |
||
233 | * |
||
234 | * @param string $source |
||
235 | * @return resource a read only stream with the contents of the remote file |
||
236 | * |
||
237 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
238 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
239 | */ |
||
240 | public function read($source) { |
||
245 | |||
246 | /** |
||
247 | * Open a readable stream top a remote file |
||
248 | * |
||
249 | * @param string $source |
||
250 | * @return resource a read only stream with the contents of the remote file |
||
251 | * |
||
252 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
253 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
254 | */ |
||
255 | public function write($source) { |
||
260 | |||
261 | /** |
||
262 | * Get extended attributes for the path |
||
263 | * |
||
264 | * @param string $path |
||
265 | * @param string $attribute attribute to get the info |
||
266 | * @return string the attribute value |
||
267 | */ |
||
268 | public function getAttribute($path, $attribute) { |
||
274 | |||
275 | /** |
||
276 | * Get extended attributes for the path |
||
277 | * |
||
278 | * @param string $path |
||
279 | * @param string $attribute attribute to get the info |
||
280 | * @param mixed $value |
||
281 | * @return string the attribute value |
||
282 | */ |
||
283 | public function setAttribute($path, $attribute, $value) { |
||
292 | |||
293 | /** |
||
294 | * @param string $path |
||
295 | * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL |
||
296 | * @return mixed |
||
297 | */ |
||
298 | public function setMode($path, $mode) { |
||
301 | |||
302 | public function __destruct() { |
||
305 | } |
||
306 |