php - 使 Satis 使用单个版本而不是整个存储库的正确语法是什么?

标签 php composer-php satis

config file syntax of Satisalmost 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/

相关文章:

php - 处理一对多数据更新的有效方法

composer-php - 如何将 composer 与包含 packages.json 的非打包 github 项目一起使用

composer-php - 如何在 Composer 中显示需要包的内容

git - 在 satis 仓库中使用本地仓库

ssh - Satis - ssh2.sftp 协议(protocol)出错

PHP - 如果其他列中的值重复,Mysql 在单列中添加值

php - 将多列绑定(bind)到 PDO 中的一个变量

PHP:编写严格的代码有什么好处吗?

php - 无法自动加载帮助文件 - Laravel 5.3

php - 是否可以使用 Composer 的存档功能在本地压缩项目?