A modern implementation of the Singleton Pattern in php.
Code taken from https://stackoverflow.com/a/37800033/3424521