我正在尝试安装BingAds API并且我一直收到错误
PHP致命错误:找不到类“Microsoft \ BingAds \ Auth \ OAuthWebAuthCodeGrant”
我检查了作曲家文件它看起来没问题。
{
"name": "microsoft/bingads",
"description": "This project provides a set of PHP client libraries that make it easy to access Bing Ads service APIs.",
"keywords": [ "php", "bingads", "bing ads", "sdk" ],
"license": "Apache-2.0",
"type": "library",
"homepage": "https://github.com/BingAds/BingAds-PHP-SDK",
"require": {
"php": ">=5.5.17",
"ext-curl": "*",
"ext-openssl": "*",
"ext-soap": "*"
},
"require-dev": {
"ext-curl": "*",
"ext-openssl": "*",
"ext-soap": "*"
},
"autoload": {
"psr-4": {
"Microsoft\\BingAds\\": "src/"
}
},
"authors": [
{
"name": "Microsoft",
"homepage": "https://github.com/BingAds/BingAds-PHP-SDK/graphs/contributors"
}
]
}
此外,OAuth2Callback.php文件看起来很好我在标题上调用use Microsoft\BingAds\Auth\OAuthWebAuthCodeGrant;
的命名空间,后来它在给出错误的行上调用类OAuthWebAuthCodeGrant()
。
文件结构如下:
- BingAds-PHP-SDK-master
- - OAuth2Callback.php
- - WebAuthHelper.php
- - composer.json
- - composer.lock
- - /samples
- - /src
- - /vendor
有人有任何线索吗?我是命名空间的新手,不完全确定它是如何工作的。谢谢!
你能分享一下OAuth2Callback.php的更多细节吗?你试过这个web app walkthrough吗?如果你在控制台中本地运行它,那么我建议从this console walkthrough开始。