1

我想安装ZF2 ZendRest 模块

如何安装它?

当我在做

php .\composer.phar install

在\供应商\zendrest。我得到:

Loading composer repositories with package information 
Installing dependencies 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
- The requested package zendframework/zend-http 1.0.0 could not be found.
  Problem 2
- The requested package zendframework/zend-uri 1.0.0 could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-    stability setting
   see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.

我应该把 ZendRest 文件夹放在哪里?

谢谢!

4

1 回答 1

2

ZendRest 依赖项没有稳定版本:zend-http 和 zend-uri(show有关现有版本,请参见下面的输出)。Composer默认依赖于稳定的包。这就是您无法安装此软件包的原因。

$ composer show zendframework/zend-http
name     : zendframework/zend-http
descrip. : provides an easy interface for preforming Hyper-Text Transfer Protocol (HTTP) requests
keywords : zf2, http
versions : 2.0.0rc4, 2.0.0rc3, 2.0.0rc2, 2.0.0-rc1, 2.0.0-beta5, 2.0.0-beta4
type     : library
...

您应该在项目中更改minimum-stabilitydev

{
    "require": {
        // ...
    },
    "minimum-stability": "dev"
}

编辑:例如以下composer.json作品。这是您在自己的项目中应该拥有的(可能有更多的依赖项):

{
    "require": {
        "zendframework/zend-rest": "*" 
    },  
    "repositories": [
        {   
            "type": "composer",
            "url": "http://packages.zendframework.com/"
        }   
    ],  
    "minimum-stability": "dev"
}
于 2012-08-23T07:11:35.263 回答