我有一个新的symfony应用程序,一个令人满意的安装(内部包管理器)和2个捆绑包。
该应用程序需要捆绑包1。
捆绑1需要捆绑2。
Bundle 2需要packagist中的其他包。
在Application上运行composer update时,它失败了,说明" bundle1 dev-master需要bundle2 dev-master - >找不到匹配的包。
...然而
当我修改应用程序以同时需要捆绑包1和2时,一切都按预期完成。
我在这里做错了什么?
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": [
{
"type": "composer",
"url": "http://bundles.internalservername.com"
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"ec/data/feeds/product-pool-data-service-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}
}
{
"name": "ec/data/feeds/product-pool-data-service-bundle",
"type": "symfony-bundle",
"description": "Data Service Bundle for Feeds Product Pool",
"keywords": ["data", "product pool", "feeds"],
"homepage": "http://internalservername.com/projects/ec/repos/productpooldataservicebundle/browse",
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "http://bundles.internalservername.com"
}
],
"require": {
"php": ">=5.3.2",
"ec/generic-service-bundle": "dev-master"
},
"require-dev": {
"symfony/framework-bundle": ">=2.1,<2.2-dev"
},
"autoload": {
"psr-0": { "Ec\\ProductPoolDataServiceBundle": "" }
},
"minimum-stability": "dev",
"target-dir": "",
"version": "0.0.1-dev"
}
{
"name": "ec/generic-service-bundle",
"type": "symfony-bundle",
"description": "Generic service bundle that all Ec REST services will extend.",
"keywords": ["generic", "service", "ecentria", "rest"],
"homepage": "http://internalservername.com/projects/EC/repos/genericservicebundle/browse",
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "http://bundles.internalservername.com"
}
],
"require": {
"php": ">=5.3.2",
"friendsofsymfony/rest-bundle": "1.3.*",
"jms/serializer-bundle": "0.13.*",
"willdurand/rest-extra-bundle": "@stable"
},
"require-dev": {
"symfony/framework-bundle": ">=2.1,<2.2-dev"
},
"autoload": {
"psr-0": { "Ec\\GenericServiceBundle": "" }
},
"minimum-stability": "dev",
"target-dir": "Ec/GenericServiceBundle",
"version": "0.0.1-dev"
}
答案 0 :(得分:1)
您需要在应用程序composer.json中指定minimum-stability: dev
。将它添加到包中的composer.json中没有任何影响。
还要从所有包composer.json文件中取出repositories
,minimum-stability
和require-dev
,因为它们只是root用户
答案 1 :(得分:0)
捆绑包1需要捆绑包2的不稳定版本,这就是它无法正常工作的原因,因为默认情况下,Composer只允许使用稳定的包。如果您希望这样做,则必须在应用程序composer.json
中设置minimum-stability
标记为dev
。
但是,如果您只想让这两个依赖项保持dev
稳定性,那么您应该手动将bundle 2添加到您的应用程序composer.json
。
我看到您为包1设置了minimum-stability
,但是,Composer只查看根(应用程序)minimum-stability
的{{1}}。所以只需添加
composer.json
到应用程序的"minimum-stability": "dev"
。