29
I’m starting to study Composer and am developing a system where I separate files from the core of the application files, as follows:
/ root |-- /src |-- /App |-- /DBConfig |-- /Controller |-- /Model |-- /Core |-- /Helper |-- /Controller |-- /Model
So, to set this configuration in the Composer.json file and get access to all classes of both /App and /Core, it would be this way?
"autoload" : { "psr-X" : { "App\\" : "/src", "Core\\" : "/src" } }
Or is there a more correct way?
I’ve read, too, about PSR-0 vs PSR-4 and I’m still a bit in doubt which one to use. In my case which one I should implement, PSR-0 or PSR-4?
Hmmm... I get it. So I think it would be better if you created an intermediate directory like: /src/Project/App/Controller/, then autoload would be just "Project ": "src/". What do you think?
– LeoFelipe
It’s also a good one. By the way, I believe better than what you were doing before.
– Gabriel Jacinto