Siam博客

调试本地composer包

2023-08-28

正文

组件包测试

在给 hyperf 框架贡献PR的时候,有时候改完想在本地起一个项目引入修改后的包来本地测试。操作过好多次,但每次都还是要去百度搜索…直接记录到博客一下

在项目的composer.json设置仓库

{
    "repositories": {
        "hyperf/http-server": {
            "type": "path",
            "url": "/dockerfile/hyperf-github/hyperf/src/http-server",
            "options": {
                "symlink": true
            }
        }
    }
}

如果要模拟版本,在包的composer.json设置

{
    "name": "hyperf/utils",
    "description": "A tools package that could help developer solved the problem quickly.",
    "license": "MIT",
    "vension":"v3.1.444"
}

create-project 骨架测试

{
    "packages": {
        "siam/hyperf-skeleton": {
            "3.1": {
                "name": "siam/hyperf-skeleton",
                "version": "3.1",
                "dist": {
                    "url": "/data/home/Siam/Code/github/hyperf/hyperf-skeleton",
                    "type": "path"
                }
            }
        }
    }
}
composer create-project  --repository=/data/home/Siam/Code/packages.json siam/hyperf-skeleton hyperf-skeleton-local
本文链接:
版权声明: 本文由 Siam原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
Tags: PHP

扫描二维码,分享此文章