1 | <?php |
||
19 | class NativeShare extends AbstractShare { |
||
20 | /** |
||
21 | * @var IServer $server |
||
22 | */ |
||
23 | private $server; |
||
24 | |||
25 | /** |
||
26 | * @var string $name |
||
27 | */ |
||
28 | private $name; |
||
29 | |||
30 | /** |
||
31 | * @var NativeState $state |
||
32 | */ |
||
33 | private $state; |
||
34 | |||
35 | /** |
||
36 | * @param IServer $server |
||
37 | * @param string $name |
||
38 | */ |
||
39 | public function __construct($server, $name) { |
||
44 | |||
45 | /** |
||
46 | * @throws \Icewind\SMB\Exception\ConnectionException |
||
47 | * @throws \Icewind\SMB\Exception\AuthenticationException |
||
48 | * @throws \Icewind\SMB\Exception\InvalidHostException |
||
49 | */ |
||
50 | protected function getState() { |
||
59 | |||
60 | /** |
||
61 | * Get the name of the share |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getName() { |
||
68 | |||
69 | private function buildUrl($path) { |
||
79 | |||
80 | /** |
||
81 | * List the content of a remote folder |
||
82 | * |
||
83 | * @param string $path |
||
84 | * @return \Icewind\SMB\IFileInfo[] |
||
85 | * |
||
86 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
87 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
88 | */ |
||
89 | public function dir($path) { |
||
106 | |||
107 | /** |
||
108 | * @param string $path |
||
109 | * @return \Icewind\SMB\IFileInfo |
||
110 | */ |
||
111 | public function stat($path) { |
||
114 | |||
115 | private function getStat($path) { |
||
118 | |||
119 | /** |
||
120 | * Create a folder on the share |
||
121 | * |
||
122 | * @param string $path |
||
123 | * @return bool |
||
124 | * |
||
125 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
126 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
127 | */ |
||
128 | public function mkdir($path) { |
||
131 | |||
132 | /** |
||
133 | * Remove a folder on the share |
||
134 | * |
||
135 | * @param string $path |
||
136 | * @return bool |
||
137 | * |
||
138 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
139 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
140 | */ |
||
141 | public function rmdir($path) { |
||
144 | |||
145 | /** |
||
146 | * Delete a file on the share |
||
147 | * |
||
148 | * @param string $path |
||
149 | * @return bool |
||
150 | * |
||
151 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
152 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
153 | */ |
||
154 | public function del($path) { |
||
157 | |||
158 | /** |
||
159 | * Rename a remote file |
||
160 | * |
||
161 | * @param string $from |
||
162 | * @param string $to |
||
163 | * @return bool |
||
164 | * |
||
165 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
166 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
167 | */ |
||
168 | public function rename($from, $to) { |
||
171 | |||
172 | /** |
||
173 | * Upload a local file |
||
174 | * |
||
175 | * @param string $source local file |
||
176 | * @param string $target remove file |
||
177 | * @return bool |
||
178 | * |
||
179 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
180 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
181 | */ |
||
182 | public function put($source, $target) { |
||
192 | |||
193 | /** |
||
194 | * Download a remote file |
||
195 | * |
||
196 | * @param string $source remove file |
||
197 | * @param string $target local file |
||
198 | * @return bool |
||
199 | * |
||
200 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
201 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
202 | * @throws \Icewind\SMB\Exception\InvalidPathException |
||
203 | * @throws \Icewind\SMB\Exception\InvalidResourceException |
||
204 | */ |
||
205 | public function get($source, $target) { |
||
232 | |||
233 | /** |
||
234 | * Open a readable stream top a remote file |
||
235 | * |
||
236 | * @param string $source |
||
237 | * @return resource a read only stream with the contents of the remote file |
||
238 | * |
||
239 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
240 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
241 | */ |
||
242 | public function read($source) { |
||
247 | |||
248 | /** |
||
249 | * Open a readable stream top a remote file |
||
250 | * |
||
251 | * @param string $source |
||
252 | * @return resource a read only stream with the contents of the remote file |
||
253 | * |
||
254 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
255 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
256 | */ |
||
257 | public function write($source) { |
||
262 | |||
263 | /** |
||
264 | * Get extended attributes for the path |
||
265 | * |
||
266 | * @param string $path |
||
267 | * @param string $attribute attribute to get the info |
||
268 | * @return string the attribute value |
||
269 | */ |
||
270 | public function getAttribute($path, $attribute) { |
||
273 | |||
274 | /** |
||
275 | * Get extended attributes for the path |
||
276 | * |
||
277 | * @param string $path |
||
278 | * @param string $attribute attribute to get the info |
||
279 | * @param mixed $value |
||
280 | * @return string the attribute value |
||
281 | */ |
||
282 | public function setAttribute($path, $attribute, $value) { |
||
289 | |||
290 | /** |
||
291 | * @param string $path |
||
292 | * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL |
||
293 | * @return mixed |
||
294 | */ |
||
295 | public function setMode($path, $mode) { |
||
298 | |||
299 | /** |
||
300 | * @param string $path |
||
301 | * @return INotifyHandler |
||
302 | */ |
||
303 | public function notify($path) { |
||
312 | |||
313 | public function __destruct() { |
||
316 | } |
||
317 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: