THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND MAINTAINABILITY USE DEPENDENCY INJECTION!
To have only one instance of this object in the application that will handle all calls.
- DB Connector
- Logger
- Config Manager
- Threads Handling
- Lock file for the application (there is only one in the filesystem ...)
You can also find this code on GitHub
Singleton.php
Singleton.php
Tests/SingletonTest.php
Tests/SingletonTest.php