I'm learning namespaces and psr-4 autoloading. In my application I can load only the classes of the first object under psr-4 in composer.json.
I will explain better, this is my situation:
Folder Structure:
app - core -- Foo --- Foo.php src - Bar -- Bar.php
in composer.json
{
"autoload":
{
"psr-4":
{
"core\\" : "app/core/",
"myapp\\" : "src/"
}
}
}
Only classes under app/core are loaded. If I use \core\Foo\Foo
works like a charm, but if I use \myapp\Bar\Bar
doesn't work. Of course I updated the autoload with composer dump-autoload -o
and respected the Case Sensitive letters.
Where is my mistake? thanks in advance :-)