
 Peter Drinnan - 2010-08-06 16:49:41
<?php
class SimpleSingleton
{
     /**
     * Instance of this class
     */
    private static $instance;
    
    /**
     * Always returns only one instance
     */
    public static function GetInstance($params = NULL)
    {
		if ( ! is_null($params) AND ! is_array($params))
		{
			$params = NULL;
		}
		
        if (!isset(self::$instance))
        {
			if ($params !== NULL)
			{
			
				self::$instance = new self($params);
			
			}
			else
			{
				self::$instance = new self();
			
			}	
            
        
        return self::$instance;
    }
    
    /**
     * Private constructor
     */
    private function __construct()
    {
        
    }
} 
?>