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

Global Installation Issue #468

Open
tylersatre opened this issue Oct 7, 2021 · 3 comments
Open

Global Installation Issue #468

tylersatre opened this issue Oct 7, 2021 · 3 comments

Comments

@tylersatre
Copy link

I was trying out doing a global installation of this package so I could keep it out of the project requirements, but ran into an issue. It looks like it's attempting to run after being globally installed because I get the error:

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
                          
  [UnexpectedValueException]   
  Imposter namespace is empty

I'm going to look in the code a bit, but I'm hoping it would be easy to make sure that if composer global is being run then the the package won't attempt to run.

@tangrufus
Copy link
Member

tangrufus commented Oct 8, 2021

Global installation is not supported yet.

I understand the desire to move imposter out of plugin vendor folders.
However, I got mixed feelings towards composer global require. See: composer/composer#5390

And, practically, if we are going to support global installation, we need to find a way to ensure global vendor folders not being modified by imposter. Any ideas?

@tylersatre
Copy link
Author

I'm going to poke around a bit today to see all the parameters composer has when it starts up. My thought was to have a check early on in the plugin that looks to see if it's composer global ... and if it's being run in the global context.

Though it would also require another check to make sure there aren't errors if a project doesn't have settings in composer.json, because I'm realizing it will try to run on any project once installed that way.

My context for wanting to install it globally is because I'm doing development of a plugin in a docker container, so if I can globally install it in the docker container I can keep it out of the project composer.json. I wouldn't run into the issue of it running when unexpected because the project is in isolation.

I may submit a PR later today if I can figure something out.

@tangrufus
Copy link
Member

Awesome!

Try https://github.com/consolidation/cgr first. It might "just work" if we put cgr and imposter together.

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

No branches or pull requests

2 participants