Skip to content

Files External: allow dynamic backend registration - #2618

Closed
Crazyphil wants to merge 12 commits into
owncloud:masterfrom
Crazyphil:master
Closed

Crazyphil wants to merge 12 commits into
owncloud:masterfrom
Crazyphil:master

Conversation

@Crazyphil

Copy link
Copy Markdown
Contributor

As discussed in pull request #2180, I've modified the files_external app to dynamically register backends instead of using a hard-coded list. I've also moved dependency checks into the backend code (where they belong IMO) instead of the OC_Mount_Config class.

External backends will have to register in their app.php, for example:

if (OC_App::isEnabled('files_external')) {
    OC::$CLASSPATH['OC\Files\Storage\RapidShare'] = 'apps/files_external_rapidshare/lib/rapidshare.php';
    OC_Mount_Config::registerBackend('OC\Files\Storage\RapidShare', array(
        'backend' => 'RapidShare',
        'configuration' => array(
            'user' => 'Username',
            'password' => '*Password',
            'root' => '&Root')));
}

Until issue #1235 is closed, external backends also will have to make sure that the files_external app was already loaded (which is not the case when the administrator first enables the backend app and then the files_external app) by calling

OC_App::loadApp('files_external');

…them

Moved dependency check to the individual backends instead of the config
@ghost

ghost commented Mar 30, 2013

Copy link
Copy Markdown

Can one of the admins verify this patch?

@karlitschek

Copy link
Copy Markdown
Contributor

Good idea. I think it makes sense to do this together with your rapdishare plugin to have a reality check. Is this already ready?

@Crazyphil

Copy link
Copy Markdown
Contributor Author

Yes, the plugin is already finished (in fact, I've tested these modifications with the RapidShare app). I've already uploaded a standalone version to apps.owncloud.org, but it's in approval since mid-March.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@owncloud-bot this is ok to test

@karlitschek

Copy link
Copy Markdown
Contributor

Can't test this at the moment but looks good.

@karlitschek

Copy link
Copy Markdown
Contributor

👍

@karlitschek

Copy link
Copy Markdown
Contributor

@MTGap What do you think?

@MTGap

MTGap commented Apr 1, 2013

Copy link
Copy Markdown
Contributor

Yes, this is what I wanted. I'll get back to you once I test it. May be a long time before I get the chance though.

@MTGap

MTGap commented May 3, 2013

Copy link
Copy Markdown
Contributor

There's been some changes to files_external so there are some conflicts in config.php now. Could you fix those @Crazyphil?

Everything looks good, but Google Drive, Dropbox, AmazonS3, and WebDAV require cURL. Someone didn't stylize cURL correctly.

DeepDiver1975 and others added 11 commits May 24, 2013 15:19
use the recoveryPassword var instead of accessing the POST array
…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
@Crazyphil

Copy link
Copy Markdown
Contributor Author

@MTGap: I think I should have managed to resolve all conflicts and rebase to the current master.

Also, I've included a check to the getBackends method to ensure that backends with dependencies do have a checkDependencies method. Otherwise, a non-existent method would be called, which is bad.

@MTGap

MTGap commented May 25, 2013

Copy link
Copy Markdown
Contributor

@Crazyphil something went wrong. How did you merge?

I'm going to suggest you open a new pull request, because right now there are 941 files changed.

@MTGap MTGap closed this May 25, 2013
@MTGap

MTGap commented May 25, 2013

Copy link
Copy Markdown
Contributor

Could you also make it so that the storages that have the same dependency i.e. cURL only show one message in the UI. Thanks.

@Crazyphil

Copy link
Copy Markdown
Contributor Author

Cleaning the commits up with a new pull request should be no problem. I merged by rebasing the repository to the current master and resolving the conflicts.

I'm currently trying to figure out the best way to show only one message per dependency. I imagine an additional backend property "system_dependencies" that contains a list of predefined dependencies (currently SMB, FTP and cURL). This way, only one message per dependency could be displayed. This approach, however, would not work for any other dependencies that are not predefined.
Any thoughts about this?

@MTGap

MTGap commented May 30, 2013

Copy link
Copy Markdown
Contributor

You should be doing git merge master

Just let the storage backends define their dependency and see if the strings match up to some length. Also, 'Warning' probably isn't a good message, nothing bad will happen so just change it to 'Note'.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants