新手请教 composer 2 个项目依赖怎么合并?

2020-06-09 10:27:34 +08:00
 pinews
不懂怎么表达,就是我现在要做一个东西要用 easyswoole 和激光 im,两边的代码都有了,怎么放在一起?自动加载两边的依赖?
1939 次点击
所在节点    PHP
5 条回复
pinews
2020-06-09 10:29:20 +08:00
es 的 json
{
"autoload": {
"psr-4": {
"App\\": "App/"
}
},
"require": {
"easyswoole/easyswoole": "3.3.7"
}
}
jg 的 json
{
"name": "jiguang/jmessage",
"type": "library",
"version": "1.1.13",
"description": "JMessage's officially supported PHP client library for accessing JMessage APIs.",
"keywords": ["jiguang", "jmessage", "API Client"],
"homepage": "https://github.com/jpush/jmessage-api-php-client",
"license": "MIT",
"authors": [
{
"name": "JiGuang",
"email": "support@jpush.cn",
"homepage": "https://www.jiguang.cn"
}
],
"require": {
"php": ">=5.4",
"ext-curl": "*"
},
"autoload" : {
"psr-4": {"JMessage\\": "src/JMessage/"}
}
}
littleylv
2020-06-09 10:40:16 +08:00
自己写一个 composer.json
{
"require": {
"easyswoole/easyswoole": "^3.3.0",
"jiguang/jmessage": "^1.1.0"
}
}

然后 composer install
pinews
2020-06-09 10:48:40 +08:00
@littleylv 好的 谢谢
cvl
2020-06-09 11:42:22 +08:00
别忘了这句
"psr-4": {"JMessage\\": "src/JMessage/"}
pinews
2020-06-09 12:01:34 +08:00
我在 esayswoole 的默认 composer.json 下加了"jiguang/jmessage": "^1.1.0",后提示
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Nothing to install or update
Generating autoload files

怎么办?小白一枚,composer 的文档看了 看不明白。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/679904

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX