-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Share API 2 #3969
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
Share API 2 #3969
Conversation
lib/share/shares.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.
get_class() returns the namespace + classname without a leading \ (OC\Share\Shares) for consistency sake I think it's best to always have a leading \ for emitter scopes
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.
Maybe using a more general scope like \OC\Share is better since the classname isn't consistence with the multiple sub classes that can exists
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.
My intention is to have it just be the classname, is there a function for just that?
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 want to have it based on the individual sub classes so you didn't have to listen to all sharing events and filter afterwards.
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.
There isn't a need to use the scope to distinguish the source that emitted the events, if you want to only listen to events from only one backend you can simple only attach the listeners to that one backend.
(also see my comments about making \OC\Share\Manager an emitter)
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.
You're right, I'll just switch it to a general scope.
|
@MTGap What about the pubic api? Do you provide a compatibility layer? |
No, I see no need to do that, because I was the main person to integrate it with apps originally anyways. It will only cause more pain. |
Well - we have no clue on which and how many apps exist out there relying on the public api. |
lib/share/share.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.
if (method_exists($instance, $method)) {
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 prefer that the exception is thrown, because it shows that something is wrong.
… trouble finding it
|
Test failed. |
|
Test failed. |
Conflicts: lib/public/share.php
Conflicts: lib/share/updater.php
|
Test failed. |
|
Test failed. |
|
Closed? @MTGap what’s up with this, any follow-up pull request? |
|
@MTGap: Seconding @jancborchardt's question. |
|
@Kondou-ger This branch is dead. We will start over for ownCloud 7 and improve sharing. But this time not with a complete rewrite that is 10x as big but with an iterative approach. |
This isn't ready to be merged yet, because this is only the backend changes. At this time I would just like a code review of the architecture. You can read this page to get a general overview: https://github.com/owncloud/core/wiki/Share-API
Besides all the new code, the largest change is storing multiple parent references for reshares because it is possible to share to the same user multiple times through group and user shares. By not referencing all parents of a reshare there were unexpected permission and unsharing issues.
This took so long, because I wrote unit tests for 'almost' all of the code. It is currently at 95.62% code coverage and the nice thing is that the tests are fast, all ~500 assertions. One test is failing because of the groups backend and is unrelated to the Share API.
Todo:
I really want to kill all sharing bugs once and for all...