Singleton
abstract class Singleton
An abstraction to apply to singleton instances for uniform initialization.
Properties
| static protected Singleton[] | $_instances |
Methods
__construct()
Require a protected constructor so existing instances can be checked against.
static Singleton
instance(mixed $args = null)
Maybe initialize singleton instance and return the instance.
static array
get_instances()
Return a copy of the instances array.
get_class_reflection()
A short one-liner tool to get a ReflectionClass so we can get runtime info for the static class instance and not this abstract.
Details
at line 33
abstract protected
__construct()
Require a protected constructor so existing instances can be checked against.
at line 42
final static Singleton
instance(mixed $args = null)
Maybe initialize singleton instance and return the instance.
at line 63
final static array
get_instances()
Return a copy of the instances array.
at line 72
final protected ReflectionClass
get_class_reflection()
A short one-liner tool to get a ReflectionClass so we can get runtime info for the static class instance and not this abstract.