Feature/files list occ command#43342
Conversation
…e for files. path or --all is required to search files in the path or based on all users
…se in file info if no files in dir covered
|
@AndyScherzinger @sorbaugh Please find the above file list implemented based on files:scan. I am not able add you as reviewers so tagged both of you in the comment here. |
Psalm errors fixed Signed-off-by: yemkareems <yemkareems@gmail.com>
composer run cs:fix Signed-off-by: yemkareems <yemkareems@gmail.com>
exectime variable removed to fix psalm error Signed-off-by: yemkareems <yemkareems@gmail.com>
type hinting corrected Signed-off-by: yemkareems <yemkareems@gmail.com>
Scan files replaced with listFiles and all methods refactored accordingly Signed-off-by: yemkareems <yemkareems@gmail.com>
path made a argument and user extraction logic based on path changed Signed-off-by: yemkareems <yemkareems@gmail.com>
help doc content changed to start with all first caps Signed-off-by: yemkareems <yemkareems@gmail.com>
| "name" => $node->getName(), | ||
| "size" => $node->getSize() . " bytes", | ||
| "perm" => $node->getPermissions(), | ||
| "owner" => $node->getOwner()->getDisplayName(), |
Check notice
Code scanning / Psalm
PossiblyNullReference
There was a problem hiding this comment.
| "owner" => $node->getOwner()->getDisplayName(), | |
| "owner" => $node->getOwner()?->getDisplayName(), |
…hors removed removed the user loop since only one user is there and copy right authors removed Signed-off-by: yemkareems <yemkareems@gmail.com>
type hinting corrected Signed-off-by: yemkareems <yemkareems@gmail.com>
cs fix ran Signed-off-by: yemkareems <yemkareems@gmail.com>
Signed-off-by: yemkareems <yemkareems@gmail.com>
userFolder type hint to fix psalm error Signed-off-by: yemkareems <yemkareems@gmail.com>
Co-authored-by: Andy Scherzinger <info@andy-scherzinger.de> Signed-off-by: yemkareems <yemkareems@gmail.com>
apps/files/lib/Command/ListFiles.php
Outdated
| ->addArgument( | ||
| "path", | ||
| InputArgument::REQUIRED, | ||
| 'Limit list to this path, eg. path="/alice/files/Music", the user_id is determined by the path parameter' |
There was a problem hiding this comment.
The description no longer matches with it being moved to and argument. (the path=)
There was a problem hiding this comment.
@icewind1991 Updated the description of the path argument
There was a problem hiding this comment.
I mean the path=... doesn't match anymore as it's no longer an option, so you no longer specify the path= part
There was a problem hiding this comment.
Hi @icewind1991 not sure if i understood it correctly because i still do occ files:list path=/admin/files/Media --type=video where path is required and the above lists all the video files in the path
updated the description of path Signed-off-by: yemkareems <yemkareems@gmail.com>
making changes to list folders as directory type Signed-off-by: yemkareems <yemkareems@gmail.com>
cs fix run for the file Signed-off-by: yemkareems <yemkareems@gmail.com>
apps/files/lib/Command/ListFiles.php
Outdated
| @@ -0,0 +1,301 @@ | |||
| <?php | |||
| /** | |||
| * @copyright Copyright (c) 2024, ownCloud, Inc. | |||
There was a problem hiding this comment.
| * @copyright Copyright (c) 2024, ownCloud, Inc. | |
| * @copyright Copyright (c) 2024 Kareem <yemkareems@gmail.com> |
| "name" => $node->getName(), | ||
| "size" => $node->getSize() . " bytes", | ||
| "perm" => $node->getPermissions(), | ||
| "owner" => $node->getOwner()->getDisplayName(), |
There was a problem hiding this comment.
| "owner" => $node->getOwner()->getDisplayName(), | |
| "owner" => $node->getOwner()?->getDisplayName(), |
|
Closing as it move here: #46352 |
files:list implemented based on files:scan
List of possible usage
all user based search
occ files:list --allpath based search
occ files:list --path /admin/filesscans the directory and sub directory also
Filter by type
Filter by file size
default sort order is desc
occ files:list --all --sort nameto do asc
occ files:list --all --sort name --order ASCNon recursive scan and list
occ files:list --path /admin/files/ --shallowThe above does not scan sub directories recursively
All the above params can be combined to have different result sets
Summary
TODO
Checklist