
composer使用本地依赖包
在composer.json
文件中添加repositories
属性,以下是内容简写:
{
"repositories": [
{
"type": "path", // 依赖类型,一般都是本地的目录
"url: "../tinker", // 路径
"options": {
"symlink": true, // 使用链接类型
}
}
]
}
你可以从官网查看repositories
属性使用文档。
添加该属性之后,我们在修改require
属性:
{
"repositories": [
{
"type": "path", // 依赖类型,一般都是本地的目录
"url: "../tinker", // 路径
"options": {
"symlink": true, // 使用链接类型
}
}
],
"require": {
"meshell/tinker": "@dev", // 使用@dev就是搜索本地`repositories`
}
}
现在就可以执行composer install
或者 composer update
命令了。