pulkitjalan / google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support
MIT License
246 stars 75 forks source link

Cleaning up unused services #70

Closed frital closed 6 days ago

frital commented 3 weeks ago

From the Google Readme: "There are over 200 Google API services. The chances are good that you will not want them all. In order to avoid shipping these dependencies with your code, you can run the Google\Task\Composer::cleanup task and specify the services you want to keep in composer.json:"

{ "require": { "google/apiclient": "^2.15.0" }, "scripts": { "pre-autoload-dump": "Google\Task\Composer::cleanup" }, "extra": { "google/apiclient-services": [ "Drive", "YouTube" ] } }

In this direction, i would suggest to include this feature in this nice project. (For server-less applications, its very important). I think that it would be only add this to the composer, or do i missing something? If yes, i can open a PR now.. if not (and more stuff is needed), i can't start now, just in some days ..

I'm grateful for your feedback... =)

pulkitjalan commented 6 days ago

This is very useful but achievable by adding that logic to your own projects composer.json. Tested on a fresh Laravel project (see screenshot). I did notice the errors were not great when requesting a service that was removed, so I improved it here, but other than that I think this should work.

Screenshot 2024-06-30 at 21 43 00