composer/composer — Issue #112: Install command does not fetch new dependencies
Author: jmikola
Created: 2011-11-16 06:56:00+00:00
State: open

Starting with the following `composer.json` file:

```json
{
"name": "project",
"version": "1.0.0",
"require": {
"imagine/Imagine": "v0.2.6"
},
"repositories": {
"imagine/Imagine": { "vcs": { "url": "git://github.com/avalanche123/Imagine.git" } }
}
}
```

Running `./composer.phar install` downloads Imagine into `vendor/` and yields the following output:

```
$ ./composer.phar install
> Installing dependencies.
Downloading https://github.com/avalanche123/Imagine/zipball/v0.2.6 to vendor/imagine/imagine/14420f6310a6ef0c68bd0a00fcd34ac0.6
Unpacking archive
Cleaning up
> Locked
> Generating autoload files
> Done
$
```

Also, the following `composer.lock` file was created:

```json
[{"package":"imagine\/imagine","version":"0.2.6.0"}]
```

I then add a new dependency to `composer.json`:

```json
{
"name": "project",
"version": "1.0.0",
"require": {
"symfony/console": "2.1.0-dev",
"imagine/Imagine": "v0.2.6"
},
"repositories": {
"imagine/Imagine": { "vcs": { "url": "git://github.com/avalanche123/Imagine.git" } }
}
}
```

Re-running `./composer.phar install` does not download the new dependency and results in the following output:

```
$ ./composer.phar install
> Found lockfile. Reading.
> Generating autoload files
> Done
$
```

The `composer.lock` file is unchanged. If I run `./composer.phar update`, the new dependency is picked up and downloaded. Am I expecting `install` to do something it shouldn't? It's not entirely clear to me what the difference between both commands is, especially since running `./composer.phar update` on a fresh directory (no vendors or lock file) will initialize and download all dependencies exactly as `install` does.