Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google PHP API too many files

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.

like image 959
Christopher Avatar asked Jan 11 '18 18:01

Christopher


1 Answers

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.

like image 192
DaImTo Avatar answered Sep 30 '22 08:09

DaImTo