gpt4 book ai didi

php - Symfony 2.3 添加 Google API

转载 作者:行者123 更新时间:2023-12-04 04:51:09 24 4
gpt4 key购买 nike

我以前用过这个 Symfony2 and Google API integration

我对此有一个疑问,当我在 compser.json 中使用 classmap 时,我能够访问 Google_Client 类,但是我无法使用任何其他类。

例如我想使用 Goole_YoutubeService .我有...

$client = new \Google_Client();
$youtube = new \Google_YoutubeService($client);

当我这样做时,我的代码会识别 Google_Client() ,但找不到 Google_YoutubeService() .

我错过了什么让这个工作吗?

这是我的 composer.json
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" },
"classmap": ["vendor/google/google-api-php-client/src","vendor/google/google-api-php-clien‌​t/src/contrib"]

},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"google/google-api-php-client": "1.0.0"

},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phake/phake": "1.*"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "alpha",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"repositories": [
{
"type": "package",
"package": {
"name": "google/google-api-php-client",
"version": "1.0.0",
"source": {
"type": "svn",
"url": "http://google-api-php-client.googlecode.com/svn",
"reference": "trunk"
}
}
}
]
}

最佳答案

试试 Google_YouTubeService - 大写 优酷 - 它会起作用

关于php - Symfony 2.3 添加 Google API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17455957/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com