PHP Composer Autoloader Class not Found Exception

前端 未结 2 850
长发绾君心
长发绾君心 2021-01-18 00:12

The title speaks itself. So here is my project structure:

|src
    |Database
        |Core
            |MySQL.php
        |Support
    start.php
|vendor
comp         


        
2条回答
  •  渐次进展
    2021-01-18 00:44

    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.

提交回复
热议问题