symfony / swiftmailer-bundle

Symfony Swiftmailer Bundle
https://symfony.com/swiftmailer-bundle
MIT License
1.56k stars 151 forks source link

SF 4.2.5 installation problem #278

Closed konradja100 closed 5 years ago

konradja100 commented 5 years ago

Hi guys, i've found some issue integrating this bundle in one of my applications. We're using this bundle in 2 other apps (SF version 4.2.5 also), and there's no problem installing it. But when it comes to this microservice, we have this message:

Screenshot_36

As you can see, i'm trying to install version ^3.2 (as we use it in other apps). Worth to mension, this service is just simple consumer for async messages (now i want to add to it functionality for sending emails).

my composer.json:

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "guzzlehttp/guzzle": "^6.3",
        "guzzlehttp/psr7": "^1.4",
        "php-http/httplug": "^1.1",
        "php-http/httplug-pack": "^1.1",
        "sentry/sentry-symfony": "^2.0",
        "symfony/amqp-pack": "^1.0",
        "symfony/console": "^4.0",
        "symfony/dotenv": "^4.0",
        "symfony/flex": "^1.1",
        "symfony/framework-bundle": "4.2.*",
        "symfony/process": "^4.0",
        "symfony/yaml": "4.2.*"
    },
    "require-dev": {
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": true,
            "require": "*"
        }
    }
}

With this requirements in other 2 applications there's no issue using swiftmailer-bundle.

Later, i've created empty installation of symfony and add this bundle with no problem.

Also, when you try to install bundle with just composer require symfony/swiftmailer-bundle you get this error: image

As you can see composer is trying to install version ^2.0, but i guess this version is incompatibile with SF 4.2.*.

Any ideas what causes this issue?

konradja100 commented 5 years ago

Solved by changing

"extra": {
        "symfony": {
            "allow-contrib": true,
            "require": "*"
        }
    }

to:

"extra": {
        "symfony": {
            "allow-contrib": true,
            "require": "4.2.*"
        }
    }