Yii的Dropbox [英] Dropbox for Yii

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

问题描述

任何人都知道如何绑定Dropbox php API http://code.google .com / p / dropbox-php / (位于Yii中)。我下载了源文件并放在ext.dropbox中,然后插入了以下代码

Has anyone any idea how to tie in the dropbox php api http://code.google.com/p/dropbox-php/ in Yii. I downloaded the source files and put in ext.dropbox and then inserted the following code

     $dropbox = Yii::getPathOfAlias('ext.dropbox');
     spl_autoload_unregister(array('YiiBase','autoload'));     
     Yii::registerAutoloader(array('Dropbox_autoload','autoload'));
       $consumerKey = '***';
       $consumerSecret = '***';
       $oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);

       try {
           $oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);
           $dropbox = new Dropbox_API($oauth);             
           $info = $dropbox->getMetaData('Files');
       } catch (Exception $e) {
           $error = "error: " . $e->getMessage();
       }

       spl_autoload_register(array('YiiBase','autoload'));

我收到错误致命错误:在中找不到类'CExceptionEvent' / strong> *

推荐答案

尝试以下操作:

$dropbox = Yii::getPathOfAlias('ext.dropbox');
     spl_autoload_unregister(array('YiiBase','autoload'));    
     Yii::registerAutoloader(array('Dropbox_autoload','autoload'));
       $consumerKey = '***';
       $consumerSecret = '***';
       $oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);

       try {
           $oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);
           $dropbox = new Dropbox_API($oauth);            
           $info = $dropbox->getMetaData('Files');
       } catch (Exception $e) {
           $error = "error: " . $e->getMessage();
       }

       spl_autoload_register(array('YiiBase','autoload'));

Yii::import('swift.classes.Swift', true);
Yii::registerAutoloader(array('Swift','autoload'));
Yii::import('swift.swift_init', true);

Yii::setPathOfAlias('swift', '/var/www/lib');

在此 Dropbox Lib
以及 PHP 5.3用于Dropbox REST API的SDK

这篇关于Yii的Dropbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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