Allow namespaced and autoloaded custom actions#94
Allow namespaced and autoloaded custom actions#94
Conversation
|
Hi @oscherler, Thanks you for your contribution and sorry for the delay in my answer but I was
Can you handle those two points or do you need help? |
|
Sounds feasible, I’ll give it a try. However, I just noticed a conflict if two different versions of the Console component are present, one in the RMT phar or installed globally with Composer and the other one loaded by the bootstrap script. I’ll have to see if I can solve this. |
|
Hi @oscherler, |
|
It’s not the tests that are blocking me, but the bootstrap functionality. If I have RMT installed globally with Composer, and I add a bootstrap file that loads my project’s Composer Maybe I should remove the bootstrap functionality while I figure out a better way? It would at least support globally loaded classes. |
With this PR, when specifying prerequisites and actions, names containing a backslash are treated as full class names, and thus are not prefixed by the internal namespaces, nor suffixed by type. This allows to use:
Moreover, inspired by PHPUnit’s
bootstrapparameter, a bootstrap script can be specified in the configuration. This allows, for example, to use classes from the current project if RMT is installed globally and the project has an autoloader. Typically:Tests are included for the configuration merging and class resolution features of
Config\Handler.The use cases for me are:
I think this PR does the trick, but I may have missed something. I’ll be glad to receive feedback about it.