composer/installers — pull request #192 by sagikazarmark (2014-10-27 00:52:44+00:00)
Title: Framework type detection

I came across with a very annoying issue. I've just submitted a PR for fuelphp components. The problem is that the installer checks for the framework type by matching the beginning of the given type with the supported list. Since `fuel` is a match for `fuelphp-component` it detects the wrong type. It sounds very specific to fuel, but if I release a framework tommorrow named `code` then codeigniter packages will be broken.

I currently solved it by reverse sorting the array by key (`krsort`) which means that the best (longest) possible match will be tested first, however if we can say that the package type must follow the `framework-type` pattern, it would be MUCH better to explode the package type by the first dash and see if that framework is supported. This would cause problems with packages like `typo3-cms-*`.

Anyway, I opened this PR with the `krsort` solution which probably solves the problem.

For the record: this whole thing could have been avoided if I write the tests for the new type (which I did now).