我只是按照 google 团队提供的说明与购物 API 进行通信:
https://developers.google.com/api-client-library/php/auth/service-accounts
一切正常,我完成了我的集成(购物 API),但我现在意识到,当我使用 composer 下载这个谷歌库时:
composer require google/apiclient:^2.0
我现在有大约 6300 个文件要提交!!!
所以,我想尝试删除我肯定不需要的东西,因为我只是使用 API 进行谷歌购物。这是我当前的 vendor/(或 lib/)文件夹结构:
这是我已经正常工作的代码示例:
require_once __DIR__.'/lib/autoload.php';
$client = new Google_Client();
putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');
$client->useApplicationDefaultCredentials();
$client->setScopes('https://www.googleapis.com/auth/content');
$client->fetchAccessTokenWithAssertion();
$service = new Google_Service_ShoppingContent($client);
即使我从不使用直接位于其他文件夹中的某些功能(例如:独白等),我也不确定它们对于 google api 是否必要(我想不是)。
因此,我希望确认可以安全删除的文件夹以及允许 google api 购物正常工作的所有内容都不会受到影响。