Skip to content

Wrong configuration detection when using environment variables #219

@Kocicak

Description

@Kocicak

Version: v3.0.0 v3.0.0-alpha v3.0.0-RC1 v2.4.8 v2.4.7 v2.4.6 v2.4.5 v2.4.4 v2.4.3 v2.4.2 v2.4.1 v2.4.0

Bug Description

When using PhpLiteral for all database configuration directives, all of them are skipped and service is not initialized.

Steps To Reproduce

bootstrap.php:

$configurator->addDynamicParameters([
    'env' => getenv()
]);

database.neon config:

database:
    dsn: %env.MYSQL_DSN%
    user: %env.MYSQL_USER%
    password: %env.MYSQL_PASSWORD%

Expected Behavior

Database gets initialized and service registered

Possible Solution

reverting comit cadc1a6#diff-2fcee4c8b8de0b3276a0db928f59d69e fixes this. Problem is that not a single configuration value is scalar. maybe change that is_scalar() condition? Add || $v instanceof PhpLiteral ?

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