gpt4 book ai didi

php - Zend 框架 Composer 包

转载 作者:行者123 更新时间:2023-12-03 01:26:01 24 4
gpt4 key购买 nike

我想添加对 zendframework/zend-db 包的依赖项,因此我将其添加到我的composer.json中:

"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework.com/"
}
],
"require": {
"php": ">=5.3.2",

"symfony/class-loader": "dev-master",
"symfony/console": "dev-master",
"symfony/filesystem": "dev-master",
"symfony/finder": "dev-master",
"symfony/locale": "dev-master",
"symfony/yaml": "dev-master",
"doctrine/dbal": "dev-master",
"zendframework/zend-db": "dev-master"
}

问题在于,composer 安装了整个 zendframework/zendframework 包。

知道为什么吗?

最佳答案

如此处所述http://packages.zendframework.com/#composer ZF2 现在提供包含所有模块的 Composer 存储库。

将存储库添加到您的包中:

"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework.com/"
}
],

从这里开始,您可以单独添加包:

"require": {
"zendframework/zend-config": "2.0.*",
"zendframework/zend-http": "2.0.*"
},

你只需要指定你想要的包,如果它们有依赖关系,它们将由compser解析。

尽管这似乎不起作用...

关于php - Zend 框架 Composer 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11747962/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com