[英]How do you get composer to install a non-composer package?
I am trying to get composer to download the following library from this project, however, it does not have a composer.json
file in it so I'm not sure if this is possible. 我正在尝试让composer从该项目中下载以下库,但是其中没有composer.json
文件,因此我不确定是否可行。
{
"require" : {
"fguillot/picoFeed" : "*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/fguillot/picoFeed"
}
]
}
Error: 错误:
[Composer\\Repository\\InvalidRepositoryException] [Composer \\ Repository \\ InvalidRepositoryException]
No valid composer.json was found in any branch or tag of https://github.com/fguillot/picoFeed , could not load a package from it. 在https://github.com/fguillot/picoFeed的任何分支或标记中均未找到有效的composer.json,无法从中加载包。
To include a non composer repository you need to set up a package repository . 要包括非作曲者存储库,您需要设置软件包存储库 。 Which would give you something like: 这会给你类似的东西:
{
"repositories": [
{
"type": "package",
"package": {
"name": "fguillot/picoFeed",
"version": "dev-master",
"source": {
"url": "https://github.com/fguillot/picoFeed",
"type": "git",
"reference": "origin/master"
}
}
}
],
"require": {
"fguillot/picoFeed": "dev-master"
}
}
As an addition to the answer from @George, regarding the comment from @DavidOliver, here's how you should be able to change the package install target: 除了@George的答案之外,关于@DavidOliver的评论 ,这是您应该如何更改软件包安装目标的方法:
"repositories" : [
{
"type" : "package",
"package" : {
"name" : "vend0r/p4ckage",
"version" : "dev-master",
"type" : "foo-library",
"dist" : {
"url" : "https://github.com/vend0r/p4ckage.git",
"type" : "vend0r/p4ckage"
},
"source" : {
"url" : "https://github.com/vend0r/p4ckage.git",
"type" : "git",
"reference" : "origin/master"
}
}
}
]
...
"extra" : {
"installer-paths" : {
"libraries/footype" : [
"type:foo-library"
],
}
}
...
"require" : {
"vend0r/p4ckage" : "dev-master"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.