Repository navigation
Conversation
|
+1 i need this for cause i publish shared package that use location of class (https://github.com/thecodingmachine/graphqlite). (ci fail not related) |
|
@moufmouf : can you check this ? |
|
Hey guys! I'm absolutely sorry, I don't know how I missed this PR. I'm having a look at it right now! |
|
Ok, I was worried that the new code might break when Composer 2 is released. So this PR looks great! |
|
I did a few more tests and this PR still needs some work I think. In particular, it will fail if the composer autoloader is generated with an authoritative classmap: In this case, every reference to PSR-0 or PSR-4 is stripped from the Composer autoloader. I'm sure we kind find a workaround around this, but this is still to be developed. |
|
@moufmouf Good one. I will have a look at it. |
|
@moufmouf Also did some tests with --classmap-authoritative enabled and disabled in several projects and I'm always getting good/same results. Am I missing something? |
|
Hey @marc-jangvs , Thanks a lot for your reactivity. Ok. I'm not 100% sure that classmap-authoritative is having an impact. Actually, I'm having trouble making this work. The Composer autoloader seems to behave in a weird way. I changed your unit test to load the "real" autoloader from Composer (rather than the test autoloader you wrote). This should work, but it fails. Having a look at what is going on, I realize that (in my case), the Did you manage to have this working for dependencies AND for project files? |
|
@moufmouf Hm that is strange. I'm using it in combination with the GraphqLite package and for example I have a simple PingController in a generic package inside vendor. Also I have some controllers inside my project that I configured inside my
Didn't do anything else to make it work. |
|
Any news on this? |
I created an extra method
createFromComposerAutoloadto load the ClassNameMapper with data of the composer autoloader.If you use the
createFromComposerFilemethod you only get the specific information of your custom added autoloading. With the new loading option you can also get information of namespaces in vendor packages.I hope you like it.