The title speaks itself. So here is my project structure:
|src
|Database
|Core
|MySQL.php
|Support
start.php
|vendor
comp
You need to include namespace when you are initializing a class:
$mysql = new Database\Core\MySQL();
or
use Database\Core\MySQL;
$mysql = new MySQL();
See Using namespaces: Aliasing/Importing
Aside from not using the right use
statement as already mentioned, PSR-4 does not work like that. It is more of an alias. You are essentially saying that src
equals Database
. So to have a directory named Database
in there would imply that the fully qualified namespace + class equals 'Database\Database\Core\MySQL`. You want to use PSR-0 in this case, or adjust your PSR-4 definition.