Home >Backend Development >PHP Tutorial >composer 自建package

composer 自建package

WBOY
WBOYOriginal
2016-06-06 20:35:091052browse

网上搜了一大堆,但是有疑问:

通过 composer init 后,
并不会将文件纳入 psr4 或者psr0 自动加载中

我想问下你们难道是自己写进去的么?而不是composer自己帮你加载进去的

如下面这一段

<code>    "autoload": {
    "psr-4": {
        "Ford\\Escape\\": "src/Ford/Escape",
        "Ford\\Fusion\\": "src/Ford/Fusion",
        "Ford\\Focus\\": "src/Ford/Focus",
        "Ford\\Fiesta\\": "src/Ford/Fiesta"
    }
   } 
</code>

回复内容:

网上搜了一大堆,但是有疑问:

通过 composer init 后,
并不会将文件纳入 psr4 或者psr0 自动加载中

我想问下你们难道是自己写进去的么?而不是composer自己帮你加载进去的

如下面这一段

<code>    "autoload": {
    "psr-4": {
        "Ford\\Escape\\": "src/Ford/Escape",
        "Ford\\Fusion\\": "src/Ford/Fusion",
        "Ford\\Focus\\": "src/Ford/Focus",
        "Ford\\Fiesta\\": "src/Ford/Fiesta"
    }
   } 
</code>

试下不就知道了!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn