DASPRiD / container-interop-doctrine

Doctrine factories for container-interop
107 stars 25 forks source link

add ability to define a custom platform #25

Closed stefanotorresi closed 6 years ago

stefanotorresi commented 7 years ago

This PR adds the ability to use a custom platform instance by setting a service name as the params key of the connection settings.

E.g.

return [
    'doctrine' => [
        'connection' => [
            'orm_default' => [
                'driver_class' => DBAL\Driver\PDOMySql\Driver::class,
                'params' => [
                    'platform' => Acme\Platform::class,
                ],
        ],
];

will use retrieve the Acme\Platform::class service from the container and use it as platform. This may be leveraged to avoid triggering automatic platform detection (my specific use case was to generate proxies without a connection ready, i.e. in a Dockerfile).

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.4%) to 46.933% when pulling be6bf16069589b8d4c8e0ed5bddc296651975723 on stefanotorresi:dbal-platform-settings into a4833d25dcfa42165c4ddec0c7062528206eeadc on DASPRiD:master.

stefanotorresi commented 6 years ago

ping @DASPRiD

thomasvargiu commented 6 years ago

@DASPRiD any news on this?

DASPRiD commented 6 years ago

Ah, thanks for the re-ping, will have a look at it tonight!

DASPRiD commented 6 years ago

Oh well, tonight was apparently 6 days later ;)