Cho*_*per 59 php symfony composer-php
我已经能够安装没有这样的composer.json文件的存储库:
{
"type": "package",
"package": {
"name": "yahoo/yui-compressor",
"version": "2.0.4",
"dist": {
"url": "http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.7.zip",
"type": "zip"
}
}
},
Run Code Online (Sandbox Code Playgroud)
我从文档中选择了"type":"zip"部分,但我找不到很多其他类型.例如,我需要安装jQuery,但我不知道要放入什么类型("js"不起作用).
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.7.2",
"dist": {
"url": "http://code.jquery.com/jquery-1.7.2.js",
"type": "js"
}
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
编辑:我正在添加完整的解决方案来帮助@CMCDragonkai:
"require": {
"vendorname/somefile": "1.2.3",
},
"repositories": [
{
"type": "package",
"package": {
"name": "vendorname/somefile",
"version": "1.2.3",
"dist": {
"url": "http://example.com/somefile.txt",
"type": "file"
}
}
}
]
Run Code Online (Sandbox Code Playgroud)
Cés*_*sar 41
实际上有一种更简单的方法来安装jQuery,只需输入:
{
"require": {
"components/jquery": "1.9.*"
}
}
Run Code Online (Sandbox Code Playgroud)
它使用Component Installer for Composer,默认情况下,所有来自Component的资产都安装在components
,但可以自定义.(见文档).
nad*_*man 35
这只是一个缺失的功能.可能应该有一种新类型的dist,它只是一个要下载并保持原样的纯文本文件.请在github问题跟踪器上提交功能请求:https://github.com/composer/composer/issues/
编辑:
该功能实际存在但未记录.
"type": "file"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
45920 次 |
最近记录: |