-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat: add occ command to scan and selete orphaned keys #55556
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Hamza <[email protected]>
This comment was marked as spam.
This comment was marked as spam.
) { | ||
parent::__construct(); | ||
|
||
$this->rootView = new View(); |
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.
new code should use IRootFolder instead of View
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.
It would be better to use Node API intead of View
.
Also it feels you took inspiration from EncryptAll which since got cleaned up: #55472
protected Util $util, | ||
protected IConfig $config, | ||
protected QuestionHelper $questionHelper, | ||
private IUserManager $userManager, | ||
private Util $encryptionUtil, |
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.
Why two Util?
$path = $folder . '/' . $item['name']; | ||
if ($this->stopCondition($path)) { | ||
$filePath = str_replace('files_encryption/keys/', '', $path); | ||
if (!$this->rootView->getFileInfo($filePath, true, true)) { |
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.
Why not file_exists
?
return false; | ||
} |
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.
return false; | |
} | |
} | |
return false; |
I suppose?
return $orphanedKeys; | ||
} | ||
|
||
private function stopCondition(string $path) : bool { |
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.
Please add a comment explaining what the function does, when does it return true/false?
Summary
TODO
Checklist
3. to review
, feature component)stable32
)