I'm running ubuntu 14.04 and noticed that when I run composer.phar update
for packages having dependency for vendors like google
, doctrine
, twig
, etc. it stores its downloaded files in my local ~/.composer/cache/files/vendor
. However, when I created a library package myself, and "required" it in another test package, it did not download these in the /cache/files/
folder (but did add entries to /repo/https---packagist.org/*.json
files).
I would like to know under what circumstances does composer.phar download the files and stores in cache? I'm asking this because I'm going to build a lot of apps in future including components like doctrine, symfony and zend frameworks and I don't want composer.phar
to waste internet bandwidth by downloading a copy of each of these frameworks again and again for each app. Of course, another advantage is that in case I decide to switch ubuntu and move on to some other distro, I don't want to download a ton of composer packages all over again.
My personal guess is that since I haven't tagged my lib package in the github repo (it is still dev-master
) it is not storing in cache. Can someone confirm that please?
1.composer.json require
section of app having dependency on google/apiclient
:
"require": {
"google/apiclient": "1.*.*"
}
2.composer.json require
section of app having dependency on prahladyeri/indiegogo
:
"require": {
"prahladyeri/indiegogo": "dev-master"
},
"license": "MIT",
"minimum-stability": "dev"
If Composer clones a git repository, it is not using the cache.
Tagged releases will be downloaded as ZIP files from the Github API, because they are usually smaller in size than the whole repository, and they are put into the cache directory.
Release early, release often. Nobody will object if you tag every commit that you feel is stable and may be used. Using semantic versioning, you have so many options to label unstable versions that are still evolving, but you help your users a great deal.