用于 Yii 的 Dropbox
有谁知道如何绑定 dropbox php api http://code.google.com/ Yii 中的 p/dropbox-php/。我下载了源文件并放入 ext.dropbox,然后插入以下代码
$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' /em>
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'));
I get the error Fatal error: Class 'CExceptionEvent' not found in *
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定 Dropbox 具体是什么,但这就是我包含 SwiftMailer 的方式:
其中 setPathOfAlias 看起来像:(
我将它用于其他应用程序,这就是为什么它不在 Yii 树中。我保留的其他库扩展目录,对于简单的扩展目录,基本的“导入”通常就足够了。)
I'm not sure about Dropbox specifically, but this is how I included SwiftMailer:
where the setPathOfAlias looks like:
(I'm using it for other apps, which is why it isn't in the Yii tree. Other libs I keep in the extensions dir and for simple ones, a basic "import" is often enough.)
试试这个:
Dropbox Lib 中还有一个 API 库可供下载
还有用于 Dropbox REST API 的 PHP 5.3 SDK
Try this one:
Also there is a API libary for download in this Dropbox Lib
and also a PHP 5.3 SDK for the Dropbox REST API