Singleton trait.

Allows a simple interface for treating a class as a singleton. Usage: myObject::instance()

Protected properties

protected static $instance

Public methods

public void __clone()

public void __wakeup()

public static void forgetInstance()

Forget this singleton's instance if it exists

public static void instance()

Create a new instance of this singleton.

Protected methods

protected void __construct()


protected void init()

Initialize the singleton free from constructor parameters.