Dropbox API在codiegniter中不起作用? [英] Dropbox api not working in codiegniter?

查看:63
本文介绍了Dropbox API在codiegniter中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public function request_dropbox()
{
    $params['key'] = 'gr3kempuvsiqsli';
    $params['secret'] = 'qtdl8lmm9r0rlk1';

    $this->load->library('dropbox', $params); 

    $data = $this->dropbox->get_request_token(base_url());
    $this->session->set_userdata('token_secret', $data['token_secret']);
    redirect($data['redirect']);
}
//This method should not be called directly, it will be called after 
//the user approves your application and dropbox redirects to it
public function access_dropbox()
{
    $params['key'] = 'gr3kempuvsiqsli';
    $params['secret'] = 'qtdl8lmm9r0rlk1';

    $this->load->library('dropbox', $params);
    $oauth = $this->dropbox->get_access_token($this->session->userdata('token_secret'));        
    $this->session->set_userdata('oauth_token', $oauth['oauth_token']);
    $this->session->set_userdata('oauth_token_secret', $oauth['oauth_token_secret']);
    redirect('welcome/test_dropbox');
}
//Once your application is approved you can proceed to load the library
//with the access token data stored in the session. If you see your account
//information printed out then you have successfully authenticated with
//dropbox and can use the library to interact with your account.
public function test_dropbox()
{
    $params['key'] = 'gr3kempuvsiqsli';
    $params['secret'] = 'qtdl8lmm9r0rlk1';
    $params['access'] = array('oauth_token'=>urlencode($this->session->userdata('oauth_token')),
                              'oauth_token_secret'=>urlencode($this->session->userdata('oauth_token_secret')));

    $this->load->library('dropbox', $params);

    $dbobj = $this->dropbox->account();

    print_r($dbobj);

}

Blockquote
i已使用Dropbox库 https://github.com/jimdoescode/CodeIgniter-Dropbox-API-Library
当我调用函数request_dropbox()时,它给我api错误:致命错误:在C:\xampp\htdocs\reports\application\libraries\Dropbox.php on上调用未定义的函数curl_init() 478行
,请帮助我如何访问保管箱文件。

Blockquote i have used Dropbox library https://github.com/jimdoescode/CodeIgniter-Dropbox-API-Library When i call to function request_dropbox() it gives me error in api "Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\reports\application\libraries\Dropbox.php on line 478" please help me how to access dropbox files.

推荐答案

请更仔细地查看您的错误,事实证明您的Xampp环境未启用curl。

Please look at your errors more carefully, it turns out that curl is not enabled on your Xampp environment.

这应该可以帮助您启用CURL并使您再次使用。

This should help you out to enable CURL and get you going again.

如何在xampp中启用curl?

这篇关于Dropbox API在codiegniter中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆