Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer require specific service #1343

Closed
enguerranws opened this issue Nov 17, 2017 · 3 comments
Closed

Composer require specific service #1343

enguerranws opened this issue Nov 17, 2017 · 3 comments
Assignees

Comments

@enguerranws
Copy link

Hi,

This is not a bug, but a question/feature request.

I'm using this client with Composer this way:

{
    "require": {
        "google/apiclient": "^2.0"
    }
}

This require the client + all Google API services and add them to vendor/. While this is useful in most of cases I think, I'm working on a Wordpress plugin, which depends on Youtube API. To upload this plugin to the WP plugins repo, I need to keep vendor/ in the repo.

Right now, with my composer.json, vendor is about 12 000 files (it includes all Google services, when I actually don't use them).

The workaround I found is to simply remove all not Youtube related folders and files in src/Google/Service. But this doesn't sound clean to me.

Would it be possible to require the client only with the service needed?

@net-tools
Copy link

Currently the Composer library for services has all services in it, and you can't ask Composer to download part of the lib. This is not the intended behavior.

However, you could download the full release) on your computer, remove all services not needed, and upload to your host only relevant files.

@mattwhisenhunt
Copy link
Contributor

There is an open issue in the services repo that will address this issue. googleapis/google-api-php-client-services#44

@Swennet
Copy link

Swennet commented Apr 11, 2018

What solution did you end up going for @enguerranws ? I have the same issue, I only need a few of the APIs and don't want to add ~20MB of files to my WordPress plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants