Skip to content

Commit 0cc7d4a

Browse files
committed
Merge branch 'release/1.0.4'
2 parents d4d9e06 + 6ccb8cd commit 0cc7d4a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/FlysystemSharepointAdapter.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace GWSN\FlysystemSharepoint;
33

44
use League\Flysystem\Config;
5+
use League\Flysystem\DirectoryAttributes;
56
use League\Flysystem\FileAttributes;
67
use League\Flysystem\FilesystemAdapter;
78
use League\Flysystem\StorageAttributes;
@@ -213,7 +214,21 @@ public function fileSize(string $path): FileAttributes
213214
*/
214215
public function listContents(string $path, bool $deep): iterable
215216
{
216-
return $this->connector->getFolder()->requestFolderItems($this->applyPrefix($path));
217+
$content = [];
218+
$result = $this->connector->getFolder()->requestFolderItems($this->applyPrefix($path));
219+
220+
if(count($result) > 0) {
221+
foreach($result as $value) {
222+
if(isset($value['folder'])) {
223+
$content[] = new DirectoryAttributes($value['name'], 'notSupported', (new \DateTime($value['lastModifiedDateTime']))->getTimestamp(), $value);
224+
}
225+
if(isset($value['file'])) {
226+
$content[] = new FileAttributes($value['name'], $value['size'], 'notSupported', (new \DateTime($value['lastModifiedDateTime']))->getTimestamp(), $value['file']['mimeType'], $value);
227+
}
228+
}
229+
}
230+
231+
return $content;
217232
}
218233

219234
/**

0 commit comments

Comments
 (0)