Question

I have a fresh symfony application, a satis install (internal package manager) and 2 bundles.

The application requires bundle 1.

Bundle 1 requires bundle 2.

Bundle 2 requires additional bundles from packagist.

When running composer update on the Application, it fails, stating that "bundle1 dev-master requires bundle2 dev-master -> no matching package found.

However...

When I modify the application to require both bundle 1 and 2, everything comes through as expected.

What am I doing wrong here?

Application composer.json:

{
    "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"
        }
    }
}

bundle 1 (ec/data/feeds/product-pool-data-service-bundle) composer.json:

{
    "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"
}

bundle 2 (ec/generic-service-bundle) composer.json

{
    "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"
}
Was it helpful?

Solution

You need to specify minimum-stability: dev in your application composer.json. This will have no affect by adding it to the composer.json in your packages.

Also take out repositories, minimum-stability and require-dev from all of your package composer.json files as they are root-only

https://getcomposer.org/doc/04-schema.md#minimum-stability

OTHER TIPS

Bundle 1 requires an unstable version of bundle 2, that's why it doesn't work, because by default Composer only allows stable packages. You have to set the minimum-stability flag in your application's composer.json to dev if you want this to work.

However, if you only want to allow those two dependencies to be in dev stability, then you should add bundle 2 to your application's composer.json manually.

Edit

I see that you have set the minimum-stability for bundle 1, however, Composer only looks at the minimum-stability of the root (application) composer.json. So simply add

"minimum-stability": "dev" 

to the application's composer.json.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top