下面由composer教程栏目给大家介绍PHP Composer怎么加载本地扩展包,希望对需要的朋友有所帮助!
目录结构:
项目下的 HttpServerFrame/composer.json
{
"name": "xxx/http-server-demo",
"authors": [
{
"name": "xxx",
"email": "xxx@xxx.com"
}
],
"autoload": {
"psr-4": {
"App\": "app/"
}
},
"repositories": {
"0": {
"type": "path",
"url": "../packages/*/*",
"options": {
"symlink": true //软链方式
}
}
},
"require": {
"xxx/http-server-frame": "dev-release",
"xxx/http-test": "dev-release"
}
}
关注这块代码
"repositories": {
"0": {
"type": "path",
"url": "../packages/*/*", //从 packages 目录下的*/* 安装此目录下必须要有composer.json
"options": {
"symlink": true //软链方式
}
}
},直接composer update 即可导入,效果如下:

以上就是PHP Composer怎么加载本地扩展包的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号