fuel/fuel/packages/auth/classes/auth.php
public static function forge($custom = array())
	{
		// Driver is given as array key or just string in custom
		$custom = ! is_array($custom) ? array('driver' => $custom) : $custom;
		$config = \Config::get('auth.'.$custom['driver'].'_config', array());
		$config = array_merge($config, $custom);

		// Driver must be set
		if (empty($config['driver']) || ! is_string($config['driver']))
		{
			throw new \AuthException('No auth driver given.');
		}

		// determine the driver to load
		$driver = \Auth_Login_Driver::forge($config);

		// get the driver's cookie name
		$id = $driver->get_id();

		// do we already have a driver instance for this cookie?
		if (isset(static::$_instances[$id]))
		{
			// if so, they must be using the same driver class!
			$class = get_class($driver);
			if ( ! static::$_instances[$id] instanceof $class)
			{
				throw new \AuthException('You can not instantiate two different login drivers using the same id "'.$id.'"');
			}
		}
		else
		{
			// store this instance
			static::$_instances[$id] = $driver;
		}

		// If we have more then one driver instance, check if we need concurrency
		if (count(static::$_instances) > 1)
		{
			// Whether to allow multiple drivers of any type, defaults to not allowed
			static::$_verify_multiple = \Config::get('auth.verify_multiple_logins', false);
		}

		return static::$_instances[$id];
	}
public static function forge($custom = array())
	{
		// Driver is given as array key or just string in custom
		$custom = ! is_array($custom) ? array('driver' => $custom) : $custom;
		$config = \Config::get('auth.'.$custom['driver'].'_config', array());
		$config = array_merge($config, $custom);

		// Driver must be set
		if (empty($config['driver']) || ! is_string($config['driver']))
		{
			throw new \AuthException('No auth driver given.');
		}

		// determine the driver to load
		$driver = \Auth_Login_Driver::forge($config);

		// get the driver's cookie name
		$id = $driver->get_id();

		// do we already have a driver instance for this cookie?
		if (isset(static::$_instances[$id]))
		{
			// if so, they must be using the same driver class!
			$class = get_class($driver);
			if ( ! static::$_instances[$id] instanceof $class)
			{
				throw new \AuthException('You can not instantiate two different login drivers using the same id "'.$id.'"');
			}
		}
		else
		{
			// store this instance
			static::$_instances[$id] = $driver;
		}

		// If we have more then one driver instance, check if we need concurrency
		if (count(static::$_instances) > 1)
		{
			// Whether to allow multiple drivers of any type, defaults to not allowed
			static::$_verify_multiple = \Config::get('auth.verify_multiple_logins', false);
		}

		return static::$_instances[$id];
	}
public static function forge ( $ custom = array ( ) ) { // Driver is given as array key or just string in custom $ custom = ! is_array ( $ custom ) ? array ( 'driver' => $ custom ) : $ custom ; $ config = \ Config :: get ( 'auth.' . $ custom [ 'driver' ] . '_config' , array ( ) ) ; $ config = array_merge ( $ config , $ custom ) ; // Driver must be set if ( empty ( $ config [ 'driver' ] ) || ! is_string ( $ config [ 'driver' ] ) ) { throw new \ AuthException ( 'No auth driver given.' ) ; } // determine the driver to load $ driver = \ Auth_Login_Driver :: forge ( $ config ) ; // get the driver's cookie name $ id = $ driver -> get_id ( ) ; // do we already have a driver instance for this cookie? if ( isset ( static :: $ _instances [ $ id ] ) ) { // if so, they must be using the same driver class! $ class = get_class ( $ driver ) ; if ( ! static :: $ _instances [ $ id ] instanceof $ class ) { throw new \ AuthException ( 'You can not instantiate two different login drivers using the same id "' . $ id . '"' ) ; } } else { // store this instance static :: $ _instances [ $ id ] = $ driver ; } // If we have more then one driver instance, check if we need concurrency if ( count ( static :: $ _instances ) > 1 ) { // Whether to allow multiple drivers of any type, defaults to not allowed static :: $ _verify_multiple = \ Config :: get ( 'auth.verify_multiple_logins' , false ) ; } return static :: $ _instances [ $ id ] ; }
Load a login driver to the array of loaded drivers

@param   Array  settings for the new driver
@throws  AuthException  on driver load failure
Load a login driver to the array of loaded drivers