Guardati il sesign pattern Singleton, è quello che fa al caso tuo.

Qui una guida: https://it.phptherightway.com/pages/...-Patterns.html