j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

How to create central connection manager? #312

Closed shokri-navid closed 7 years ago

shokri-navid commented 7 years ago

I want to create multiple repository class which are responsible for CRUD opration on my database entities. How can i create a connection and keep alive it for all of my application live cycle? Is there any best practice?

tag commented 7 years ago

This question is better suited for StackOverflow than as an issue ticket or feature request.

In addition, managing connections is best left to libraries, unless you have an absolute need for such a thing. And unless you are running a massive high-traffic site (e.g., Twitter), chances are you won't need such a thing (YAGNI).

Lastly, this is outside the scope of Paris/Idiorm.

shokri-navid commented 7 years ago

I add this question to the SO but others down vote me... and there is no answer