Download the PHP package xiian/composer-repo-tool without Composer
On this page you can find all versions of the php package xiian/composer-repo-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xiian/composer-repo-tool
More information about xiian/composer-repo-tool
Files in xiian/composer-repo-tool
Package composer-repo-tool
Short Description Easily manage custom repositories in your composer setup.
License MIT
Informations about the package composer-repo-tool
composer-repo-tool
Manage repositories defined inside your composer.json
Current functionality is limited to converting github repositories of type git
to type vcs
(which then enables composer to download archive dists instead of cloning every time).
It is also heavily opinionated for the use case I had when writing it, so your mileage may vary and pull requests welcome.
Installation
If you're even thinking of using this tool, you're already familiar with composer. It's all pretty standard.
This will install ./vendor/bin/composer-repo-tool
for use inside your project.
You can also install globally:
Which installs into $COMPOSER_HOME/vendor/bin/
, which should already be in your $PATH.
Usage
To update a single package's repository:
To update all repositories:
You can also pass a --dry-run
flag to see what the tool would do, without actually doing any of it.
Under the Hood
The update
command will perform the following steps for each package given:
- Rewrite the
composer.json
repositories
entry for the given package- Use
vcs
instead ofgit
- Convert URL from
git@$GITHUB_URL:$USER/$REPO.git
tohttps://$GITHUB_URL/$USER/$REPO.git
- Use
- Phsycially remove the package from the
vendor/
directory - Run
composer update
with proper params to switch to usingdist
instead ofsource
- Perform a git commit of the
composer.lock
andcomposer.json
files. (I told you this was opinionated)
The update:all
command will perform the above steps for every single package that is installed that does not have a dist
associated with it in the composer.lock
file.
TODO
- Decouple the source control stuff. I like the idea of being able to perform a task after every package has been updated (for atomicity), but not everybody wants the same thing.
- Batch mode.
update:all
is kind of slow because it's performing the full update cycle for every package. If atomicity isn't a concern, all of those updates could be done together, andcomposer update
would only need to be run once, which would greatly speed things up. - Integrate with
composer
more directly. Using the internals ofcomposer/composer
could speed things up a bit by skipping some likely redundant steps ofcomposer update
.
All versions of composer-repo-tool with dependencies
pds/skeleton Version ^1.0
php Version ^5.6 || ^7.0
symfony/process Version ^3.2