summaryrefslogtreecommitdiff
path: root/lpf/lib/Singleton.class.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-01-08 17:45:50 -0800
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-01-08 17:45:50 -0800
commit4c58c41d818918b1690b56f05876d9af642354c0 (patch)
treeb07c0f2925a5753ab3c34379db5c90c5dc38bad1 /lpf/lib/Singleton.class.php
parent83e460cdc3fc09867a3adb48c3d0894579dd3050 (diff)
parent3d64793a1ee45857856be1cd71c3a0a040a3e869 (diff)
add message manager back as another app depending on umummm
Diffstat (limited to 'lpf/lib/Singleton.class.php')
-rw-r--r--lpf/lib/Singleton.class.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lpf/lib/Singleton.class.php b/lpf/lib/Singleton.class.php
new file mode 100644
index 0000000..2f8c74f
--- /dev/null
+++ b/lpf/lib/Singleton.class.php
@@ -0,0 +1,12 @@
+<?php
+
+abstract class Singleton {
+ private static $instances = array();
+ public static function getInstance() {
+ $class = get_called_class();
+ if (!isset(self::$instances[$class])) {
+ self::$instances[$class] = new $class;
+ }
+ return self::$instances[$class];
+ }
+}