Skip to content
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

[VD:Dropbox] API v1 is deprecated #1598

Closed
nao-pon opened this issue Aug 16, 2016 · 12 comments
Closed

[VD:Dropbox] API v1 is deprecated #1598

nao-pon opened this issue Aug 16, 2016 · 12 comments
Assignees
Labels

Comments

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

On June 28, 2017, API v1 will be turned off, so it's time to move to API v2.

@applibs
Copy link

applibs commented Sep 24, 2016

When it will be ready for testing please? No reason to wait to last day before deadline.

@applibs
Copy link

applibs commented Oct 12, 2016

Do you plan fix it please?

@nao-pon
Copy link
Member Author

nao-pon commented Oct 12, 2016

@standus At the latest we want to handle up to V1 is finished, but I have not enough time now. 2017 first quarter about somehow to ...

@applibs
Copy link

applibs commented Oct 12, 2016

Time is very very fast.

@nao-pon
Copy link
Member Author

nao-pon commented Mar 6, 2017

There is no official APIv2 PHP SDK, so we need to select a third party SDK.

Currently there are two SDKs.

I will select kunalvarma05/dropbox-php-sdk. I ask for your opinion.

@applibs
Copy link

applibs commented Mar 6, 2017

When it will be ready for testing?

@nao-pon nao-pon self-assigned this Mar 7, 2017
@nao-pon
Copy link
Member Author

nao-pon commented Mar 7, 2017

@standus I started coding from today. I think that it will be possible to test in a couple of days.

@nao-pon nao-pon closed this as completed in 710223e Mar 8, 2017
@nao-pon
Copy link
Member Author

nao-pon commented Mar 8, 2017

I done. We can be testing in nightly build.

Thanks! 😄

@applibs
Copy link

applibs commented Mar 8, 2017

Can you publish your config for Dropbox please? I tested with my old config and it doesn`t work.
This is my config:

if($dropboxDB) {
    $opts['roots'][]=array(
        'driver'            => 'Dropbox2',
        'path'              => '/',
        'quarantine'        => $quarantinefiles,
        'tmpPath'           => $tmpfiles,
        'tmbPath'           => $tmbfiles,
        'tmbURL'            => $tmpurl,
        'tmbCrop'           => false,
        'tmbSize'           => 150,
        'alias'             => 'Dropbox',
        'tmbBgColor'        => 'transparent',
        'consumerKey'       => $dropbox['consumerKey'],
        'consumerSecret'    => $dropbox['consumerSecret'],
        'accessToken'       => $dropbox['accessToken'],
        'accessTokenSecret' => $dropbox['accessTokenSecret'],
        'URL'               => $url.$subFolder,
    );
}

@applibs
Copy link

applibs commented Mar 8, 2017

If anybody will test it on localhost with this error:
cURL error 77: error setting certificate verify locations: CAfile: C:\xampp\apache\conf\cacert.pem CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I solved it by this solution:
http://stackoverflow.com/questions/30240840/laravel-5-socialite-curl-error-77-error-setting-certificate-verify-locations#answer-37011569

@applibs
Copy link

applibs commented Mar 8, 2017

OK Naoki,
I think that it work as expected but I am not soo lucky. Why? You used 3rd party library which is dependent on another 3rd party libs.
In final Dropbox 2 driver needs next 125kb + 655kb depend source code. Ohh.
In my another project I used very simple DropBox 2 class with 25kb of size:
https://github.com/f4bsch/DropPHP/tree/api-v2 , without dependencies.
I understand that its very very simple use 3rd party code, but solutions like this is very expensive for any project.
Kunnu DB lib is very early version v0.1.x ! Looks good how complex it is, but is it needed for EF?
When developers will using solutions like this, their projects will looks like big pile of mess.
For only one functionality its to much code and files.
Otherwise thank you for your very good work.

@nao-pon
Copy link
Member Author

nao-pon commented Mar 8, 2017

I did not know DropPHP until now. The size of the library is small and good, but I think that Kunnu DB lib has versatility.
Additional third party library guzzlehttp/guzzle is also used with the Google Drive driver, it is very useful to have centralized control with composer.

By the way, it's about configure.

Changed option name consumerKey to app_key and consumerSecret toapp_secret or define constant ELFINDER_DROPBOX_APPKEY and ELFINDER_DROPBOX_APPSECRET.

Dropbox2 use the OAuth2 so it need access token for OAuth2. You can get it from https://www.dropbox.com/developers/apps (Generated access token).

Code example is

// load composer autoload before load elFinder autoload If you need composer
require './vendor/autoload.php';

// elFinder autoload
require './autoload.php';
// ===============================================

// Required for Dropbox network mount
// Installation by composer
// `composer require kunalvarma05/dropbox-php-sdk`
// Enable network mount
elFinder::$netDrivers['dropbox2'] = 'Dropbox2';
// Dropbox2 Netmount driver need next two settings. You can get at https://www.dropbox.com/developers/apps
// AND reuire regist redirect url to "YOUR_CONNECTOR_URL?cmd=netmount&protocol=dropbox2&host=1"
define('ELFINDER_DROPBOX_APPKEY',    'YOUR APP KEY');
define('ELFINDER_DROPBOX_APPSECRET', 'YOUR APP SECRET');
// ===============================================

AND

array(
	'alias'        => 'elFinder@Dropbox',
	'driver'       => 'Dropbox2',
	'path'         => '/Public/elFinder',
	'access_token' => 'YOUR TOKEN You can get from https://www.dropbox.com/developers/apps',
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants