I tested back and forth for a while with PHP 5.5.3, and although I have to report that everything looked broken during testing (most likely due to the fact that I made VM with this version in a short time, without settings and wronk keyboard layout), at the end I cannot reproduce the error. I would say that autoload for signs works like an advertisement.
Now here is what I did:
In the home directory:
composer.json { "autoload": {"psr-0":{"User":"src"}} }
also:
test.php <?php require "vendor/autoload.php"; class Auth { use User; } new Auth;
In the src directory:
src/User.php <?php trait User {}
Running composer install creates vendor/composer/autoload_namespaces.php using this array entry:
'User' => array($baseDir . '/src'),
And running the script works for me.
Please note that it is important to properly name the files. They must match exactly according to the rules of PSR-0 (or PSR-4 if you prefer to use namespaces), including the correct case-sensitive file names.
If you have a trait named “User” and you define PSR-0 startup as “User”: “Verification”, the expected situation will be that the following file exists: Validation/User.php with content:
<?php trait User {
Then this flag will be automatically downloaded after starting at least once composer install .
Sven
source share