puli / issues

The Puli issue tracker.
90 stars 5 forks source link

Discovery: must install the Composer plugin in PHP packages? #160

Closed mnapoli closed 8 years ago

mnapoli commented 8 years ago

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:

But since php-di/configuration is defined in Kernel, and since the Composer plugin is not installed, Puli doesn't see that php-di/configuration exists in php-di/twig-module.

As a result, I can't use that type. In those cases, should I:

webmozart commented 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?

mnapoli commented 8 years ago

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).