1

我当前的文件夹结构:Composer/PluginInstaller.php

composer.json 的内容:

{
    "name": "zepluf/installer",
    "type": "composer-installer",
    "description": "Composer installer for ZePLUF addons.",
    "homepage": "http://github.com/zepluf/installer",
    "license": "custom",
    "authors": [
        {
            "name": "Raine Ng",
            "email": "vunguyen@rubikin.com",
            "homepage": "http://rubikin.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "Zepluf\\Composer": "Composer"
        }
    },
    "extra": {
        "class": "Zepluf\\Composer\\PluginInstaller"
    },
    "target-dir": "zepluf/Composer"
}

我希望将安装程序放在里面:

供应商/zepluf/Composer/PluginInstaller.php

问题是我不断得到:

致命错误:第 102 行的 phar://C:/Prog ramData/Composer/bin/composer.phar/src/Composer/Installer/InstallerInstaller.php 中找不到类“Zepluf\Composer\PluginInstaller”

任何指针将不胜感激

4

1 回答 1

1

假设 PluginInstaller.php 在你的包的根目录下,它应该这样配置:

// ...

"autoload": {
    "psr-0": {
        "Zepluf\\Composer": ""
    }
},
"extra": {
    "class": "Zepluf\\Composer\\PluginInstaller"
},
"target-dir": "Zepluf/Composer"
于 2013-01-01T19:59:00.950 回答