Comments (3)
@xtreamwayz Thank you for your question.
To share the orm configuration you should have a DoctrineOrmConfigurationFactory
which creates a new instance of Doctrine\ORM\Configuration
. Then retrieve this instance in your DoctrineConnectionFactory
via the container (service locator).
With this approach you share the same configuration instance for orm_default and orm_second. You can also extend your connection array to configure all the things. A good but more complex example can you find in the DoctrineORMModule.
The same applies for the cache instance. Every object, which is used in a factory to create the specific instance, should be retrieved via the container (service locator). There is no reason why not to share the configuration and cache instance between the two database conncections and you have the option to make it configurable.
There are more benefits here. Less objects, one initialization (proxies) and one connection (redis).
from interop-config.
@xtreamwayz After some disucssions I'm working on a flexible config structure depth in #26 so you are now able to use all the options, independing under which key they are stored. Please take a look at the updated example section.
Have you any further suggestions or can you close this issue now?
from interop-config.
Oh, thank you very much. I'll play with these changes tomorrow.
from interop-config.
Related Issues (16)
- Public methods really needed? HOT 5
- Support for recursive mandatory options check HOT 1
- Avoid inheritance and use a Trait HOT 4
- [proposal] Naming proposal for option keys HOT 5
- Should `canRetrieveOptions` check for mandatory options HOT 2
- Inconsistencies in interfaces HOT 5
- Create console tools to generate/display config based on factories
- Check order of default and mandatory options HOT 6
- All errors at once
- PhpUnit failure when testing a basic example HOT 2
- Add config validation CLI command
- Allow PHP 8 HOT 1
- Better names - Replace component with package HOT 3
- Introducing HasOptionalOptions Interface HOT 2
- Introducing HasDefaultOptions Interface HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interop-config.