Zend Framework Composer Packages(Zend Framework Composer 包)
问题描述
我想给 zendframework/zend-db 包添加依赖,所以我把它添加到了我的 composer.json:
I would like to add dependency to zendframework/zend-db package, so I added it to my 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 包.
The problem is that composer installs entire zendframework/zendframework package.
知道为什么吗?
推荐答案
这里是 composer.json 来自 zend github 中的 zend-db.根据文件,zend-db没有任何依赖关系.
Here's the composer.json from zend-db in the zend github. According to the file, zend-db does not have any dependencies.
这可能是因为您尝试从 dev-master 下载包,而 dev-master 的 composer.json 中存在不匹配.
This can be due to the fact that you're trying to download a package from dev-master and there's a missmatch in the composer.json of the dev-master.
建议您将所需版本更改为 2.0.* 之类的版本,然后重试.
此外,尽管 Zend 框架是松耦合的,但在旧版本的框架中,依赖关系并不明确.
Also, Although Zend Framework is loosely coupled, in the older versions of the framework the dependencies were not explicit.
例如,通过快速浏览 ZEND 1.9 中的 zend_db 源代码,我发现它至少依赖于以下软件包:
For instance, with a quick sweep over the source code of zend_db from ZEND 1.9, I found that it depends, at least, on the following packages:
- 控制器
- 配置
- 过滤器
- json
- 加载器(对于自动加载,我认为由于 composer 自动加载器,这可能不是必需的)
- 乌里
- 查看
- 野火
这些包可能有其他依赖关系,因此下载大小.无论如何,正如 King 解释的那样,Zend Framework 2.0 与 1.9 版本不同,也许这不适用于 2.0
These packages might have other dependencies, hence the download size. Regardless, as King explained, Zend Framework 2.0 is different from version 1.9 and maybe this is not applicable to 2.0
这篇关于Zend Framework Composer 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Zend Framework Composer 包
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何替换eregi() 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
