Quantcast
Channel: package manager – SitePoint
Viewing all articles
Browse latest Browse all 12

Composer Global Require Considered Harmful?

$
0
0

We've discussed Composer best practices before, and I've always advocated using composer global require when installing packages that can be used across several projects - particularly command line tools. Then, the other day, I ran into this discussion.

[author_more]

Sad Composer

The short of it is - the majority of people now seem to feel like global require is bad practice, unless the globally installed package has zero dependencies. Technically, this makes sense when one is using a single environment for all their projects, but as I commented in that discussion, when using a VM per project or a properly isolated environment like Docker or the like, then this problem is moot and global literally cannot do harm.

The OP's suggested solution to this problem is:

As an alternative, users should use composer require to install each commandline tool to its own local project, and manage their $PATH or binaries manually (e.g. by creating symlinks from a bin directory already in the $PATH).

Continue reading %Composer Global Require Considered Harmful?%


Viewing all articles
Browse latest Browse all 12

Trending Articles