如何配置composer安装路径?

时间:2017-05-18 07:31:57

标签: composer-php composer.json

我刚刚在https://packagist.org/发布了我的php帮助程序库 (回复:https://github.com/eacevedof/prj_theframework_helpers)。

使用此命令:composer需要框架/帮助程序安装正常但我对安装路径感觉不舒服:

我希望这是最终的作曲家路径: / vendor / theframework / helpers / 但是: / theframework / helpers / theframework / helpers /

这是我的composer.json:

{
  "version":"0.0.2",
  "updated":"20170514",
  "name": "theframework/helpers",
  "type":"library",
  "description": "Library for helping to create html elements using objects",
  "minimum-stability": "stable",
  "keywords": [
    "helpers","html elements","view helpers"
  ],
  "homepage": "https://github.com/eacevedof/prj_theframework_helpers",
  "license": "MIT",
  "authors": [
    {
        "name": "Eduardo Acevedo Farje",
        "email": "eacevedof@gmail.com",
        "homepage": "http://eduardoaf.com",
        "role": "Developer",
        "github":"https://github.com/eacevedof/",
        "site":"helpers.theframework.es"             
    }
  ],
  "require": {
    "php": ">=5.3.0"
  },
  "autoload": {
    "files": ["theframework/helpers/autoload.php"]
  }    
}

我该如何解决这个问题?。

提前完成。

1 个答案:

答案 0 :(得分:1)

将存储库中的文件移动到根目录,而不是将它们放在子目录中。 vendor/foo/bar基本上是您的包根,并且由于您的包(git repo)再次包含foo/bar,您最终会得到vendor/foo/bar/foo/bar