-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Custom wrapper to handle commands in oC #28701
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
Conversation
lib/private/Files/CustomView.php
Outdated
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 ? and if really needed, why not extend 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.
Modifying to go with extend View
10bd16c to
39dd4b0
Compare
A custom wrapper to handle command transfer-ownership. In this wrapper we can make changes for functions like fopen or any other routines. Signed-off-by: Sujith H <sharidasan@owncloud.com>
39dd4b0 to
0b56bec
Compare
| * | ||
| * @return bool|mixed | ||
| */ | ||
| public function renameCustom($path1, $path2) { |
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.
mind posting a diff between rename() and renameCustom() ? they look very similar and I don't really see what the difference is and why this is needed
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.
Here is the diff between rename() and renameCustom()
sujith@sujith-Inspiron-5567 ~ $ diff rename_function.php customrename_function.php
9c9
< public function rename($path1, $path2) {
---
> public function renameCustom($path1, $path2) {
80d79
< // moving a file/folder between storages (from $storage1 to $storage2)
82c81
< $result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2);
---
> $result = $storage2->moveFromStorageCustom($storage1, $internalPath1, $internalPath2, true, true);
sujith@sujith-Inspiron-5567 ~ $
The difference is the call to moveFromStorageCustom in customView's renameCustom() method. Otherwise the function remains same.
moveFromStorageCustom() is a wrapper function which resides at Wrapper/CustomEncryption.php
|
Thanks. As discussed, try getting rid of the Since this custom view is calling a storage method with extra args, try simply writing that method call In general I'm still not happy that we need to add these extra flags to a "standard" storage method, we'll need to think of a better solution. Maybe there's a way to move the logic that enables itself through these flags, move that logic to the CustomEncryptionWrapper. |
|
@sharidas obsolete ? please close and link to your new PR |
|
Obsolete PR. The PR which implements the design or implementation for the change is #28774 |
A custom wrapper to handle command transfer-ownership.
In this wrapper we can make changes for functions like
fopen or any other routines.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
A custom wrapper created along with a custom view so that changes required for common functions like fopen arguments or so can be handled here. Primarily the focus is for command transfer-ownership and later we would use for other command like recreate master key.
Related Issue
Motivation and Context
This change would prevent the modification to common routines which were made to arguments of functions like fopen or copy etc. And use this wrapper for custom changes.
How Has This Been Tested?
WIP
Screenshots (if appropriate):
Types of changes
Checklist: