Google PHP API too many files

感情迁移 提交于 2020-05-09 02:34:22

问题


I am trying to create a plugin for WordPress using the Google Analytics Reporting API v4 https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php

We need to load the Google API PHP Client Library require_once __DIR__ . '/vendor/autoload.php';

I have downloaded the latest release of Google API https://github.com/google/google-api-php-client/releases but the vendor folder contains more than 7000 files!

My question is if I am doing something wrong here or I am missing something? Inside the vendor folder I can see all the Google services. How I can use the Google API with less files in a WordPress plugin? I will appreciate any help to the right direction.


回答1:


By default the Google/Service directory contains all the code needed to access every Google Discovery services API. You don't technically need all of the files. You can safely delete everything under Google/Service that you don't need.

Dont delete files from any of the other directories. Just remove the unneeded APIs.



来源:https://stackoverflow.com/questions/48214056/google-php-api-too-many-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!