summaryrefslogtreecommitdiff
path: root/apps/um/lib/Singleton.class.php
blob: 2f8c74f2a36dd9130680c5db8eaf4b67a1966107 (plain)
1
2
3
4
5
6
7
8
9
10
11
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];
	}
}