Closed mnapoli closed 8 years ago
You should use --force
in this case.
Bindings and Binding Types are a decoupled mechanism to pull packages together. If someone uses your packages, and if they want to bind things automatically, then they have to install the Composer plugin.
Any suggestion for making the docs clearer on this?
Thanks for the answer.
After having played more with all this I realized it made no sense to not require the composer plugin in my "framework" (unless you can see a reason not to). I don't want end users to have to require the framework + require the Puli composer plugin, so it seems it makes sense to require it. That removes (it seems) the need for using --force
, so in that case the documentation might be good here:
The bind command fails if the binding type is not found. You should always install the packages defining the binding types you are using …
I.e. I don't see a reason anymore to change that wording (again, unless there is a reason for me not to require the composer plugin in the framework).
The documentation does not instruct to install the Composer plugin for PHP packages. However, in my situation it seems I have to, let me explain:
php-di/kernel
defines a typephp-di/configuration
php-di/twig-module
requires the previous and defines a binding tophp-di/configuration
But since
php-di/configuration
is defined in Kernel, and since the Composer plugin is not installed, Puli doesn't see thatphp-di/configuration
exists inphp-di/twig-module
.As a result, I can't use that type. In those cases, should I:
--force
to force defining the binding even though the type is not defined?