Skip to content

Let apps register Sabre plugins or collections (#26761)#2829

Closed
LukasReschke wants to merge 1 commit into
masterfrom
dav-plugins-from-apps
Closed

Let apps register Sabre plugins or collections (#26761)#2829
LukasReschke wants to merge 1 commit into
masterfrom
dav-plugins-from-apps

Conversation

@LukasReschke

Copy link
Copy Markdown
Member

From owncloud/core#26761 – let's see what our integration tests say to this.

* Let apps register Sabre plugins or collections

* Move comments DAV plugins to comments app

* Fix use OCP\AppFramework\QueryException;

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
@LukasReschke LukasReschke added 3. to review Waiting for reviews downstream labels Dec 22, 2016
@LukasReschke LukasReschke added this to the Nextcloud 12.0 milestone Dec 22, 2016
@mention-bot

Copy link
Copy Markdown

@LukasReschke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @blizzz, @rullzer and @nickvergessen to be potential reviewers.

return [];
}

private function loadSabrePluginsFromInfoXml($plugins) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change that to array $plugins

return [];
}

private function extractCollectionList($array) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array $array

}
}

private function loadSabreCollectionsFromInfoXml($collections) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array $collections

* @return array
*/
public function getAppPlugins() {
if (is_null($this->plugins)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-12-22 at 15 38 10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, what's the difference?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance, is_null is a function and therefor slower:
http://stackoverflow.com/questions/8228837/is-nullx-vs-x-null-in-php

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, according to a user comment on php.net is_null is actually faster on php7 http://php.net/manual/en/function.is-null.php#117344

* @return array
*/
public function getAppCollections() {
if (is_null($this->collections)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-12-22 at 15 38 10

foreach ($this->appManager->getInstalledApps() as $app) {
// load plugins and collections from info.xml
$info = $this->appManager->getAppInfo($app);
if (!isset($info['types']) || !in_array('dav', $info['types'])) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-12-22 at 15 38 34

@LukasReschke LukasReschke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Dec 22, 2016
*/

namespace OCA\DAV\Comments;
namespace OCA\Comments\Dav;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks 3rd party apps, that use comments, because now the file comments app needs to be enabled, while prior it worked because dav is force enabled.

So I'd like to not do this 😞

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments infrastructure was also intentionally decoupled from comments on files feature, what the comments app eventually does. Also not a fan.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So @LukasReschke want to split the comments moving out of this PR? I think it makes sense to merge the base, but as said above not doing it for existing features.

@slowhand93

Copy link
Copy Markdown

Hey!
Any update on this?

@juliusknorr

Copy link
Copy Markdown
Member

I've cherry-picked the plugin/collection changes in #6835

I guess we can close this, since the comments code should stay in the dav app.

@blizzz blizzz deleted the dav-plugins-from-apps branch October 16, 2017 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants