Zend Framework Composer 包

Zend Framework Composer Packages(Zend Framework Composer 包)
本文介绍了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 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)