Skip to content

Conversation

@sharidas
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sharidas sharidas added this to the development milestone Aug 16, 2017
@sharidas sharidas self-assigned this Aug 16, 2017
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

@sharidas sharidas force-pushed the transfer-ownership-rework branch 8 times, most recently from 10bd16c to 39dd4b0 Compare August 21, 2017 05:56
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>
@sharidas sharidas force-pushed the transfer-ownership-rework branch from 39dd4b0 to 0b56bec Compare August 21, 2017 11:52
@sharidas sharidas changed the title [WIP] Custom wrapper to handle commands in oC Custom wrapper to handle commands in oC Aug 21, 2017
*
* @return bool|mixed
*/
public function renameCustom($path1, $path2) {
Copy link
Contributor

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

Copy link
Contributor Author

@sharidas sharidas Aug 21, 2017

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

@PVince81
Copy link
Contributor

Thanks. As discussed, try getting rid of the CustomView as it causes too much code duplication.

Since this custom view is calling a storage method with extra args, try simply writing that method call moveFromStorage and copyFromStorage directly inside the CustomEncryptionWrapper, and then set the two flags when passing down the 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.

@PVince81
Copy link
Contributor

@sharidas obsolete ? please close and link to your new PR

@sharidas
Copy link
Contributor Author

Obsolete PR. The PR which implements the design or implementation for the change is #28774

@sharidas sharidas closed this Aug 28, 2017
@PVince81 PVince81 deleted the transfer-ownership-rework branch September 27, 2018 13:36
@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants