gpt4 book ai didi

svn - composer安装本地svn依赖

转载 作者:行者123 更新时间:2023-12-02 08:34:38 25 4
gpt4 key购买 nike

目前我的项目通过 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 informationInstalling 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.

我可以执行主项目下载依赖项的唯一方法是将存储库定义为,但这样 Composer 就不会在我的依赖项中运行composer install

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

最佳答案

经过一些研究,我在 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.*"    }}

关于svn - composer安装本地svn依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23120841/

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