I have the follow project structure:
- root
|- src <- Application specifc source
|- [...]
|- tests
|- [...]
|- Vendor
|- myusername <- shared packages for all projects
|- src
|- MyNamespace
|- File.php
|- autoload.php
|- test.php
|- composer.json
composer.json
already have a PSR-4 entry:
"autoload": {
"psr-4": {
"MyNamespace\\":"myusername/src"
}
}
/Vendor/test.php
<?php
require 'autoload.php';
$file = new MyNamespace\File();
echo $file->isDone();
Vendor/myusername/src/MyNamespace/File.php
<?php
namespace MyNamespace;
class File
{
public function isDone()
{
return 'Done!';
}
}
But I always get fatal error Fatal error: Class 'MyNamespace\File' not found in [...]
Are the composer settings or file structure correct? What I can do?
EDIT 1:
I can load external vendors fine