CodeIgniter Forums
Dropbox library - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Dropbox library (/showthread.php?tid=78075)

Dropbox library - pippuccio76 - 11-26-2020

I , i try to use a dropbox class ( used in another project without framework) with ci 4 :

With composer i install on my localhost and move into my project under App\Libraries\Dropbox

i Have change all namespace from f.e. :

namespace Kunnu\Dropbox\DropboxFile

to :

namespace App\Libraries\Dropbox\Kunnu\Dropbox\DropboxFile;

in my controller  :

use App\Libraries\Dropbox\Kunnu\Dropbox\DropboxApp;
class Dropbox_api extends BaseController
    public function index()
        //classi api dropbox
        $app = new App\Libraries\Dropbox\DropboxApp('xxxxxxxxxxxxxx','xxxxxxxxxxxx','sl.xxxxxxxx');

        //Configure Dropbox service
        $dropbox = new Dropbox($app);

But i have this  error :

Class 'App\Controllers\App\Libraries\Dropbox\DropboxApp' not found

RE: Dropbox library - pippuccio76 - 11-26-2020

i solved in part , it seem that cannot use Kunnu\Dropbox but only the path for example (i create a folder Dropbox and insert source inside)

the code that work is:

namespace App\Libraries\Dropbox;

instead of App\Libraries\Dropbox\Kunnu\Dropbox;

Its a big work because there are several folder out of this for example Guzzlehttp , Psr7 ecc

now the problem is that one class use a function instead a class , how can i import every function of this script ?