THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND MAINTAINABILITY USE DEPENDENCY INJECTION!
To have only a list of named instances that are used, like a singleton but with n instances.
- 2 DB Connectors, e.g. one for MySQL, the other for SQLite
- multiple Loggers (one for debug messages, one for errors)
You can also find this code on GitHub
Multiton.php
.. literalinclude:: Multiton.php :language: php :linenos: