dflydev / dflydev-embedded-composer

Embed Composer into another application
MIT License
71 stars 17 forks source link

Exceptions ignored when composer.json / $externalComposerFilename not found #18

Open becw opened 9 years ago

becw commented 9 years ago

See the use of $this->error in https://github.com/dflydev/dflydev-embedded-composer/blob/master/src/Dflydev/EmbeddedComposer/Core/EmbeddedComposerBuilder.php#L137

For some projects (ie, Sculpin), the composer.json is optional, so these exceptions should not be thrown; for other projects, they may be meaningful/required.

simensen commented 9 years ago

I think the solution would be to have builder have some sort of strict mode enabling thing.

    ->shouldExceptionOnMissingExternalComposerFilename()

... or somesuch. In this case it would actually throw an exception if the file is missing. Otherwise, we could just continue to silently consume these exceptions.