config file syntax of Satis是almost like Composer's .
此示例 Satis 配置适用于比较:
{
"name": "local/repository",
"homepage": "http://localhost/",
"repositories": [
{
"name": "doctrine/inflector",
"type": "git",
"url": "https://github.com/doctrine/inflector.git"
},
{
"name": "laravel/laravel",
"type": "git",
"url": "https://github.com/laravel/laravel.git"
}
],
"require-all": true,
"archive": {
"directory": "dist"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"secure-http": false
}
}
然而,Satis 从指定的 GitHub 存储库下载所有可用版本。在这种情况下,所有 Laravel 版本和所有 Inflector 版本。
但我只想要一个包 - 最新版本,来自下载的 zip 文件(我从远程包存储库 (GitHub) 下载的 zip)。
下载的 zip 文件的正确配置可能是什么而不是 Satis repositories
block 中的当前名称/类型/url 组合?
或者,为了使用下载的 zip 文件,我需要做一些完全不同的事情?
我尝试了一些,但都以各种错误告终
最佳答案
好的,我找到了使 Satis 配置单个 zip 文件的正确语法。在以下示例中,我使用了在线获取的完整 git 存储库和本地计算机上的一个 zip 文件:
{
"name": "local/repository",
"homepage": "http://localhost/",
"repositories": [
{
"type": "package",
"package": {
"name": "doctrine/inflector",
"version": "2.0.4",
"dist": {
"url": "C:/path/to/zip_files/inflector.zip",
"type": "zip"
}
}
},
{
"name": "laravel/laravel",
"type": "git",
"url": "https://github.com/laravel/laravel.git"
}
],
"require-all": true,
"archive": {
"directory": "dist"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"secure-http": false
}
}
关于php - 使 Satis 使用单个版本而不是整个存储库的正确语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73493801/