PSR-4 autoloading with Composer

后端 未结 1 1166
再見小時候
再見小時候 2020-12-31 01:56

I run a portail with composer\'s autoloading class system:

\"autoload\": {
    \"psr-4\": {
        \"Portal\\\\\": \"src/\"
    }
}

It wor

相关标签:
1条回答
  • 2020-12-31 02:28

    There are two ways to fix it.

    1. change composer.json to

      "Portal\\Core\\": "src/core/"
      
    2. Or rename the core directory to Core

    https://getcomposer.org/doc/04-schema.md#psr-4

    The subdirectory name MUST match the case of the sub-namespace names.

    http://www.php-fig.org/psr/psr-4/

    0 讨论(0)
提交回复
热议问题