Import Dropbox Library

Hello all,

I’m trying to implement the Dropbox library take from BenTheDesigner/Dropbox but I’m facing some problem…

I placed the Dropbox library under the Extensions folder, this is the code:

YiiBase::setPathOfAlias('YiiDropBoxAPI', Yii::getPathOfAlias('application.extensions.DropboxAPI.Dropbox'));

class YiiDropBoxAPI extends CApplicationComponent {


	public function createSession() {




		// Check whether to use HTTPS and set the callback URL

		$protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';

		$callback = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];


		// Instantiate the Encrypter and storage objects

		$encrypter = new \Dropbox\OAuth\Storage\Encrypter('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');


		// User ID assigned by your auth system (used by persistent storage handlers)

		$userID = 1;


		// Instantiate the database data store and connect

		$storage = new \Dropbox\OAuth\Storage\PDO($encrypter, $userID);

		$storage->connect('localhost', 'dropbox', 'root', 'xxx', 3306);

		// Create the consumer and API objects

		$OAuth = new \Dropbox\OAuth\Consumer\Curl($key, $secret, $storage, $callback);

		$dropbox = new \Dropbox\API($OAuth);





But when i run the code i have this error:

PHP Fatal error:  Class 'Dropbox\\OAuth\\Storage\\Encrypter' not found in /var/www/public_html/lavatmel/protected/extensions/DropboxAPI/YiiDropBoxAPI.php on line 17

Anyone has successfully integrated the Dropbox SDK into Yii?