Repository navigation
Conversation
…them Moved dependency check to the individual backends instead of the config
…them Moved dependency check to the individual backends instead of the config
Added check for backend's checkDependencies method to OC_Mount_Config::getBackends() when backend is configured to have some instead of blindly calling it and crashing
Added check for duplicate dependency check messages to display only the first
|
@MTGap What do you think? |
|
Amazon S3, Dropbox, and SWIFT also depend on cURL. |
|
Done. Anything else? |
|
tested with webdav and demo.owncloud.org, 👍 |
|
I actually wanted it to list all of the backends that aren't possible to mount if it's the same dependency. That's what I meant by the dependency shown only once. It might be best to rethink this so we can do this easily while considering translations. What about checkDependencies only returns the name of the dependency, the message is pretty much the same afterwards anyways? Then it would be easier to match them up. Also, the checkDependencies function should be at the end of the storage files, not at the beginning. And does anyone know what dependencies SFTP has? Is it the same as FTP? |
|
In my opinion, there are disadvantages either way: If you just return the name of the dependency, you lose the ability to show any backend-specific information (e.g. installation instructions) in the message, which basically means that you can't really check for any other than the already defined dependencies. On the other hand, if you return a full message, there is no easy way to merge these messages into a single one. If you just merge them for specific dependencies, there is again the possibility that two different backends depend on another module and you have duplicate messages all over again. There has to be a tradeoff between flexibility and "beauty". |
|
If we’re discussing a tradeoff, let’s go for the simple thing first, we can always refine. And I think that »simple« first thing is what you call »beauty« (combining the messages into one per dependecy, as @MTGap said). |
sftp has dependencies to https://github.com/owncloud/core/tree/master/apps/files_external/3rdparty/phpseclib |
|
Well, it doesn't look like it has any required dependencies: http://phpseclib.sourceforge.net/ |
|
@Crazyphil stuff to do before I want to merge it in:
|
|
@MTGap: Unfortunately, I don't have much time for coding in the next few weeks (exams and stuff). If you finally want to get rid of this pull request, I could, however, do the things in your list so you can merge it before further changes to the app are made and have to be included again. Moving the notices below the configuration has its advantages, because it doesn't distract from the configuration task. However, this might also cause administrators to skip the messages accidentially when they don't read further. Tricky... Apart from that, I might have found a solution for the multiple messages that should also enhance translatability in comparison to the current solution: What if checkDependency would, as you suggested, return the name(s) of the missing dependencies and, optionally, a message to display. If a message is given, it is displayed as-is. If no message is given, all backends with the same missing dependency are included in a single system-defined message that reads checkDependency would therefore do something like return array('cURL', 'foo' => 'Download foo at http://www.example.com/'); |
|
I like your idea for checkDependency. There is no rush at this time, don't do anything until your exams are done. |
Dependency messages now appear below the configuration options instead of above Reworked dependency check method to support consolidated messages for multiple backends
|
@MTGap: All changes done. Any comments? |
|
Test passed. |
|
@Crazyphil You should follow this git tutorial: http://try.github.io/ I'm not sure how to fix this pull request at this moment. I also can't test it because of 3rdparty changes it seems. |
|
I, too, have noticed while testing that the Google API fails when cURL is disabled, such that the settings page is not displayed anymore. I simply commented the Google backend registration and just tested the remaining backends. Obviously, this doesn't work if you want to test everything... Thanks for the link! |
|
Can someone take this over? @butonic can you check this out? |
|
@Crazyphil care to rebase this? Will help, review and merge asap. |
|
@butonic I'd try, even if it didn't work out the last two times. |
|
Did something go wrong with the rebasing ? 777 files changes seem to be a bit big. If this PR really changes that much, I'd suggest making incremental changes instead, splitting this into smaller PRs that are easier to review and test. |
|
I’m closing this pull request for now because of inactivity and because it’s just too big. @Crazyphil we can always reopen it though! :) Better would be to make small steps, as mentioned above. Several small pull requests are easier to review than one big one, which is in danger of not getting fully reviewed or accepted, as here. |
|
@jancborchardt I'm reopening this because I'd love to see the funtionality to dynamically register file backends @Crazyphil if you agree - I'll hijack your code and continue - any objections? @PVince81 this it the pull request I've been talking about in #7897 (comment) |
|
agreed. This would be a very helpful thing to have |
|
🚀 Test Passed. 🚀 |
|
@DeepDiver1975 No objections at all, I'm glad if my code helps in any way. Unfortunately, I currently don't have time to fix that. Just ignore 0e848b1, c4d5688 and 48836f7 (the commits with "Merge ..." and you should get the changes that matter. |
|
@Crazyphil thanks a lot! I'll take care |
|
will continue to live here: #8032 |
Original pull request: #2618, now with clean commits.
Also, the dependency messages are now notices instead of warnings and duplicate messages are filtered by comparing their first sentences.