fuel/fuel/core/classes/mongo/db.php
public static function instance($name = 'default')
	{
		if (\array_key_exists($name, static::$instances))
		{
			return static::$instances[$name];
		}

		if (empty(static::$instances))
		{
			\Config::load('db', true);
		}

		if ( ! ($config = \Config::get('db.mongo.'.$name)))
		{
			throw new \Mongo_DbException('Invalid instance name given.');
		}

		static::$instances[$name] = new static($config);

		return static::$instances[$name];
	}
public static function instance($name = 'default')
	{
		if (\array_key_exists($name, static::$instances))
		{
			return static::$instances[$name];
		}

		if (empty(static::$instances))
		{
			\Config::load('db', true);
		}

		if ( ! ($config = \Config::get('db.mongo.'.$name)))
		{
			throw new \Mongo_DbException('Invalid instance name given.');
		}

		static::$instances[$name] = new static($config);

		return static::$instances[$name];
	}
public static function instance ( $ name = 'default' ) { if ( \ array_key_exists ( $ name , static :: $ instances ) ) { return static :: $ instances [ $ name ] ; } if ( empty ( static :: $ instances ) ) { \ Config :: load ( 'db' , true ) ; } if ( ! ( $ config = \ Config :: get ( 'db.mongo.' . $ name ) ) ) { throw new \ Mongo_DbException ( 'Invalid instance name given.' ) ; } static :: $ instances [ $ name ] = new static ( $ config ) ; return static :: $ instances [ $ name ] ; }
Acts as a Multiton.  Will return the requested instance, or will create
a new one if it does not exist.

@param   string    $name  The instance name
@return  Mongo_Db
Acts as a Multiton . Will return the requested instance or will create a new one if it does not exist .