You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I have to get all elements of a path and check if the original path matches the path of the current $item. This is inefficient and I don't know if there is a way to get the file or directory directly through a listContent($path).
$contents=$filesystem->listContents(dirname($ruta))->toArray();
foreach ($contents as $item) {
if ($item['path']==$ruta || str_replace('\\', '/',$item['path']) == $ruta) { // /a/b/c.txt == /a/b/c.txt
if ($item instanceof FileAttributes) {
return new FileAttributes($ruta,$item->fileSize(),$item->visibility(),$item->lastModified(),$item->mimeType(),$item->extraMetadata());
} elseif ($item instanceof \League\Flysystem\DirectoryAttributes) {
return new DirectoryAttributes($ruta,$item->visibility(),$item->lastModified(),$item->extraMetadata());
}
}
}
The text was updated successfully, but these errors were encountered:
Question
Hello,
is there any way to get the json of a single item?
example:
Currently I have to get all elements of a path and check if the original path matches the path of the current $item. This is inefficient and I don't know if there is a way to get the file or directory directly through a listContent($path).
The text was updated successfully, but these errors were encountered: