It’s one of the best kept secrets of popular PHP dependency manager Composer: How to flush composers cache.
You normally don’t need it, however if you create some composer.json and you want to put it to a test, this can be useful to know. Or let’s imagine your composer cache grows some gigabytes large. Here are two ways:
First, you can just nuke it from above:
$ rm -rf "`composer config cache-dir`"
(if you’re using Windows, use git-bash.)
The second way is to tell Composer where to find the cache via environment variables:
$ COMPOSER_CACHE_DIR=/dev/null composer install
This second method is perhaps better if in your tests you don’t want to influence the whole system.
The third but not yet available method is to make use of a composer command. This is discussed in the feature request Add command to clear composer cache which also exchanges some arguments pro and con. But I though I spare that for this little TLDR; type of blog-post.
Update 14 Jul: See as well If all else fails Slide of Using composer correctly (confoo) (26 Feb 2014 by Igor Wiedler).