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 | 255 | 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 | 255 | protected function getState() { |
|
59 | |||
60 | /** |
||
61 | * Get the name of the share |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 1 | public function getName() { |
|
68 | |||
69 | 255 | 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 | 255 | public function dir($path) { |
|
103 | |||
104 | /** |
||
105 | * @param string $path |
||
106 | * @return \Icewind\SMB\IFileInfo |
||
107 | */ |
||
108 | 33 | public function stat($path) { |
|
111 | |||
112 | 114 | /** |
|
113 | 114 | * Get fstat |
|
114 | * |
||
115 | * @param string $path |
||
116 | * @return array |
||
117 | */ |
||
118 | public function getStat($path) { |
||
121 | |||
122 | /** |
||
123 | * Create a folder on the share |
||
124 | * |
||
125 | 255 | * @param string $path |
|
126 | 255 | * @return bool |
|
127 | * |
||
128 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
129 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
130 | */ |
||
131 | public function mkdir($path) { |
||
134 | |||
135 | /** |
||
136 | * Remove a folder on the share |
||
137 | * |
||
138 | 255 | * @param string $path |
|
139 | 255 | * @return bool |
|
140 | * |
||
141 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
142 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
143 | */ |
||
144 | public function rmdir($path) { |
||
147 | |||
148 | /** |
||
149 | * Delete a file on the share |
||
150 | * |
||
151 | 133 | * @param string $path |
|
152 | 133 | * @return bool |
|
153 | * |
||
154 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
155 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
156 | */ |
||
157 | public function del($path) { |
||
160 | |||
161 | /** |
||
162 | * Rename a remote file |
||
163 | * |
||
164 | * @param string $from |
||
165 | 28 | * @param string $to |
|
166 | 28 | * @return bool |
|
167 | * |
||
168 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
169 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
170 | */ |
||
171 | public function rename($from, $to) { |
||
174 | |||
175 | /** |
||
176 | * Upload a local file |
||
177 | * |
||
178 | * @param string $source local file |
||
179 | 113 | * @param string $target remove file |
|
180 | 113 | * @return bool |
|
181 | 113 | * |
|
182 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
183 | 102 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
|
184 | 102 | */ |
|
185 | 102 | public function put($source, $target) { |
|
195 | |||
196 | /** |
||
197 | * Download a remote file |
||
198 | * |
||
199 | * @param string $source remove file |
||
200 | * @param string $target local file |
||
201 | * @return bool |
||
202 | 44 | * |
|
203 | 44 | * @throws \Icewind\SMB\Exception\NotFoundException |
|
204 | 9 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
|
205 | * @throws \Icewind\SMB\Exception\InvalidPathException |
||
206 | 35 | * @throws \Icewind\SMB\Exception\InvalidResourceException |
|
207 | 35 | */ |
|
208 | 1 | public function get($source, $target) { |
|
235 | |||
236 | /** |
||
237 | * Open a readable stream to a remote file |
||
238 | * |
||
239 | 29 | * @param string $source |
|
240 | 29 | * @return resource a read only stream with the contents of the remote file |
|
241 | 20 | * |
|
242 | 20 | * @throws \Icewind\SMB\Exception\NotFoundException |
|
243 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
244 | */ |
||
245 | public function read($source) { |
||
250 | |||
251 | /** |
||
252 | * Open a writeable stream to a remote file |
||
253 | * Note: This method will truncate the file to 0bytes first |
||
254 | 29 | * |
|
255 | 29 | * @param string $source |
|
256 | 20 | * @return resource a writeable stream |
|
257 | 20 | * |
|
258 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
259 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
260 | */ |
||
261 | public function write($source) { |
||
266 | |||
267 | 14 | /** |
|
268 | 14 | * Open a writeable stream and set the cursor to the end of the stream |
|
269 | * |
||
270 | * @param string $source |
||
271 | * @return resource a writeable stream |
||
272 | * |
||
273 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
274 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
275 | */ |
||
276 | public function append($source) { |
||
281 | 8 | ||
282 | 8 | /** |
|
283 | 8 | * Get extended attributes for the path |
|
284 | * |
||
285 | 8 | * @param string $path |
|
286 | * @param string $attribute attribute to get the info |
||
287 | * @return string the attribute value |
||
288 | */ |
||
289 | public function getAttribute($path, $attribute) { |
||
292 | |||
293 | 8 | /** |
|
294 | 8 | * Set extended attributes for the given path |
|
295 | * |
||
296 | * @param string $path |
||
297 | * @param string $attribute attribute to get the info |
||
298 | * @param mixed $value |
||
299 | * @return string the attribute value |
||
300 | */ |
||
301 | public function setAttribute($path, $attribute, $value) { |
||
309 | |||
310 | /** |
||
311 | 255 | * Set DOS comaptible node mode |
|
312 | 255 | * |
|
313 | 255 | * @param string $path |
|
314 | * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL |
||
315 | * @return mixed |
||
316 | */ |
||
317 | public function setMode($path, $mode) { |
||
320 | |||
321 | /** |
||
322 | * Start smb notify listener |
||
323 | * Note: This is a blocking call |
||
324 | * |
||
325 | * @param string $path |
||
326 | * @return INotifyHandler |
||
327 | */ |
||
328 | public function notify($path) { |
||
337 | |||
338 | public function __destruct() { |
||
341 | } |
||
342 |
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: