Autoload.php composer. Не подгружается Class
У меня не получается загрузить приватную библиотку в автозагрузчик.
Ошибка, что неизвестный класс в index.php SystemCoreMessage.
После добавленя PSR-4 в composer.json я выполнил composer update.
Файловая структура:
- library/
- internal/
- scm/
- src/
- SystemCoreMessage.php
- public/
- index.php
- composer.json
Composer:
{
"autoload": {
"psr-4": {
"SystemCoreMessage\\": "library/internal/scm/scr/"
}
}
}
Index:
<?php
require_once realpath(__DIR__ . '/../vendor/autoload.php');
use SystemCoreMessage\SystemCoreMessage;
$sys_header = null;
$scm_header = null;
$scm = new SystemCoreMessage($sys_header, $scm_header);
SystemCoreMessage.php
<?php
namespace SystemCoreMessage;
class SystemCoreMessage {
...
}
Ответы (1 шт):
Автор решения: Алексей Шиманский
→ Ссылка
Попробуйте сделать composer dump-autoload для того, чтобы автолоадер обновил пути