-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow scanning for metadata with occ scan:file --metadata #32309
Conversation
Signed-off-by: Carl Schwan <[email protected]>
6a611e3
to
b59fd08
Compare
// FIXME ugly hack to get it working for local file | ||
array_shift($pathParts); | ||
array_shift($pathParts); | ||
array_shift($pathParts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can add an argument to explode
to only do so for the first three or something and then keep the rest
did you check if using Filesystem::resolvePath would work here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that these array_shift shouldn't even exists :( This should work:
$info = Filesystem::getFileInfo($path);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc $path
is absolute here right?
Inject a IRootFolder
into the command and use IRootFolder::get
instead of using the old static filesystem apis
// FIXME ugly hack to get it working for local file | ||
array_shift($pathParts); | ||
array_shift($pathParts); | ||
array_shift($pathParts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc $path
is absolute here right?
Inject a IRootFolder
into the command and use IRootFolder::get
instead of using the old static filesystem apis
\OC::$server->get(LoggerInterface::class) | ||
); | ||
|
||
# check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception | ||
|
||
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { | ||
/** @var MetadataManager $metadataManager */ | ||
$metadataManager = \OC::$server->get(MetadataManager::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be injected instead of possible
Just testing NC25... |
obsoleted by #33511 |
This is an option since the scanning will take longer with the metadata scanning
Currently, the getNodeForPath function also needs to be fixed since the path manipulation with array_shift shouldn't be required, but I have no idea what to do instead. This was copied from the hookconnector class