在composer上安装本地svn依赖

Fre*_*ges 2 svn composer-php

目前我的项目通过版本SVN,它也使用Composer来控制它们的依赖关系.在我的一个项目中,我试图将另一个项目设置为我的依赖项,但我不能这样做.

在我的主项目中,我试图设置composer.json如下:

{
    "name": "my/project",
    "description": "",
    "repositories": [
        {
            "type": "svn",
            "url": "http://myhost.com:81/svn/Dependency/",
            "branches-path": "branches/",
            "tags-path": "tags/",
            "trunk-path": "trunk/"
        }
    ],
    "require": {
        "my/dependency": "1.0.0"
    }
}

composer.json我的依赖:

{
    "name": "my/dependency",
    "description": "",
    "version": "1.0.0",
    "autoload": {
        "psr-0": {
            "Hasteasy\\": "lib/"
        }
    },
    "require": {
        "php": ">=5.3.2"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    }
}

在我运行的主项目中composer install,会发生以下情况:

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package my/dependency could not be found in any version, there may be a typo in the package name.

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  for more details.

Read  for further common problems.

我可以完成主项目下载依赖的唯一方法是将存储库定义为package,但这样作曲家不会composer install在我的依赖项中运行.

有什么建议可以解决这个问题?我要离开去执行一些配置了?

Fre*_*ges 6

经过一些研究后,我发现composer.json必须设置一个参数:"minimum-stability": "dev"
在主项目中设置后,依赖项已成功下载.
我的文件如下:

主要项目:

{
    "name": "my/project",
    "description": "",
    "repositories": [
        {
            "type": "svn",
            "url": "http://myhost.com:81/svn/Dependency/"
        }
    ],
    "require": {
        "my/dependency": "dev"
    },
    "minimum-stability": "dev
}

依赖项目:

{
    "name": "my/dependency",
    "description": "",
    "version": "1.0.0",
    "autoload": {
        "psr-0": {
            "Hasteasy\\": "lib/"
        }
    },
    "require": {
        "php": ">=5.3.2"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    }
}