Skip to content

Issues with CompilerPass and dotenv variables in non DEV environments #42

@fnagel

Description

@fnagel

I've integrated the https://github.com/sulu/SuluArticleBundle bundle in my existing Sulu CMS project. ArticleBundle has a dependency to this package.

Locally (in the DEV environment) everything works fine but when I deploy everything to my STAGE server in order to show it to my client, I got an error on composer install (more specific: the clear cache script running after installing the packages):

In Dsn.php line 48: The mailer DSN must contain a scheme.

I can reproduce this locally as soon as my APP_ENV is stage or prod. Locally I'm using MailHog for catching mails, so the MAILER_DSN env variable should be smtp://mailhog:1025, but as soon as I change the to APP_ENV=stage, its env_4629ca8b26cb32bb_MAILER_DSN_5e62afca55f2f3bd1c033c3715bf615e (output from the \Symfony\Component\Mailer\Transport\Dsn::fromString).

It seems this is related to this #32 change in the compiler repository pass class: https://github.com/handcraftedinthealps/ElasticsearchBundle/blob/5.x/DependencyInjection/Compiler/RepositoryPass.php

If I remove the content of the file, everything works again. I assume its related to caching in non DEV environments but wasn't able to figure out what exactly is the issue here.

Can somebody help? Maybe @alexander-schranz?

Here is my composer.lock file: composer.lock.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions