summaryrefslogtreecommitdiff
path: root/src/lib/Singleton.class.php
blob: 4eb3bb392f27e77cb2501428dc6b2e71853b3da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php

abstract class Singleton {
	private static $obj;
	public static function getInstance() {
		if (!isset(self::$obj)) {
			$class = get_called_class();
			self::$obj = new $class;
		}
		return self::$obj;
	}
}