PHP 中的 OAuth 扩展加载
嗨,我真的很挣扎这个问题。
我正在使用 Google Analytics 和 Google Adwords 进行开发;我在 API Helper Libraries 中使用由 Google 编写的两个独立的 Oauth 库。一个是 Adwords 的扩展 (oauth.so),另一个只是 Analytics 的 PHP 类。
当我更改 php.ini 文件以加载扩展时,我的 Analytics OAuth 中断。我认为这可能是类名冲突?我尝试过更改名称,但没有成功。我原以为我想出了一个解决方案:使用 dl() 函数在 Adwords 相关页面上动态加载 oauth.so 扩展(它们是单独的脚本):
dl('oauth.so');
这在命令行上效果很好!但它在浏览器中不起作用。我不相信以前没有人遇到过这个问题。我知道从 php.ini 加载扩展可以在浏览器中工作,它只是禁用 Analytics 类。任何有这方面经验的人,我很想听听您的意见,如果您有任何建议,请随时提出!
谢谢
Hi I am really struggling with this one.
I am developing with Google Analytics and Google Adwords; and I am using two separate Oauth libraries in the API Helper Libraries that are written by Google. One is an extension (oauth.so) for Adwords and the other is just a PHP class for Analytics.
When I alter my php.ini file to load the extension, my Analytics OAuth breaks. I think it maybe a conflict of the class names? I have tried changing the name, but haven't had any luck. I had thought that I came up with a solution: Using the dl() function to dynamically load the oauth.so extension on just the Adwords related pages (they are separate scripts):
dl('oauth.so');
Which works great on the command line! But it doesn't work in the browser. I refuse to believe that nobody has come across this issue before. I know that loading the extension from php.ini works in the browser, it just disables the Analytics class. Any one with experience with this, I'd love to hear your input, if you have any suggestions please feel free!
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AdWords API PHP 客户端库已更新,支持不同的 OAuth 库:
http://code.google.com/p/google-api-adwords-php/source/detail?r=178
您甚至可以编写自己的利用现有 OAuth 库的 OAuthHandler 类分析库用途。
The AdWords API PHP client library has been updated to allow for different OAuth libraries:
http://code.google.com/p/google-api-adwords-php/source/detail?r=178
You could even write your own OAuthHandler class that utilized the existing OAuth library that the Analytics library uses.
它已被
从某些 SAPI 中删除
,或者切换到 Web 服务器的CGI
(brr),或者尝试使用您的 Analytics PHP 类修复该问题。It's been
removed from some SAPI's
, either switch toCGI
for the webserver (brr), or try to fix the problem with your Analytics PHP class.