Google PHP API 文件过多 [英] Google PHP API too many files

查看:21
本文介绍了Google PHP API 文件过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Google Analytics Reporting API v4 为 WordPress 创建插件 https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php

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

我们需要加载 Google API PHP 客户端库require_once __DIR__ .'/vendor/autoload.php';

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

我已经下载了最新版本的 Google API https://github.com/google/google-api-php-client/releases 但供应商文件夹包含 7000 多个文件!

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!

我的问题是我在这里做错了什么还是遗漏了什么?在供应商文件夹中,我可以看到所有的 Google 服务.如何在 WordPress 插件中以较少的文件使用 Google API?我将不胜感激任何对正确方向的帮助.

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.

推荐答案

默认情况下,Google/Service 目录包含访问每个 Google Discovery 服务 API 所需的所有代码.从技术上讲,您不需要所有文件.您可以安全地删除 Google/Service 下不需要的所有内容.

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.

不要从任何其他目录中删除文件.只需删除不需要的 API.

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

这篇关于Google PHP API 文件过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆