wheregroup / doctrine-dbal-shims
Doctrine DBAL / ORM convenience for mixed multi-connection setups
Installs: 7 991
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
- doctrine/dbal: ^3.2
Suggests
- doctrine/dbal-bundle: To use compiler pass integration
This package is auto-updated.
Last update: 2024-10-15 09:46:56 UTC
README
Included is an event subscriber that automatically sets Oracle session variables required by DBAL and Doctrine ORM to work properly (date formats etc).
Unlike the DBAL default implementation, this can be added globally, and will check / only act on Oracle DBAL connections. All other connection types will be completely left alone.
This makes it easier to use in mixed multi-connection setups, and indeed safe to use with zero Oracle connections.
Usage
With doctrine/dbal-bundle
installed, you can register the included AddOracleSessionInitPass
into your Symfony container build, or use the PassIndex to do it for you.
# Bundle class public function build(ContainerBuilder $container) { <...> PassIndex::autoRegisterAll($container); <...> }
# Kernel class public function buildContainer() { $container = parent::buildContainer(); <...> PassIndex::autoRegisterAll($container); <...> return $container; }
Standalone DBAL
Without Symfony and the Doctrine bundle, compiler passes won't work.
The OnDemandOracleSessionInit subscriber instance needs to be added to the connection's event manager in some other way to do anything.