public static function factory($config = array()) {
		$default = array(
      'base_url' => 'https://my.rightscale.com/',
      'version' => '1.0',
      'curl.CURLOPT_FOLLOWLOCATION' => false,
      'curl.CURLOPT_RETURNTRANSFER' => true
    );
		$required = array ('acct_num', 'base_url', 'version');
		$config = Inspector::prepareConfig ( $config, $default, $required );
		
		$client = new self ( $config->get( 'base_url' ),
			$config->get('acct_num'),
      $config->get('oauth_refresh_token'),
			$config->get('email'),
			$config->get('password'),
			$config->get('version')
		);
		$client->setConfig ( $config );
		
		// Add the XML service description to the client
    $path = __DIR__ . DIRECTORY_SEPARATOR . 'rs_guzzle_client_v'. $client->getVersion() . '.xml';
    $client->setDescription(ServiceDescription::factory($path));

		// Keep them cookies
		$client->cookieJar = new IndiscriminateArrayCookieJar();
    $client->getEventDispatcher()->addSubscriber(new CookiePlugin($client->cookieJar));

    $client->getEventDispatcher()->addSubscriber(new HttpAuthenticationPlugin($client));
    $client->getEventDispatcher()->addSubscriber(new ShardAwarenessPlugin($client));

		return $client;
	}
public static function factory($config = array()) {
		$default = array(
      'base_url' => 'https://my.rightscale.com/',
      'version' => '1.0',
      'curl.CURLOPT_FOLLOWLOCATION' => false,
      'curl.CURLOPT_RETURNTRANSFER' => true
    );
		$required = array ('acct_num', 'base_url', 'version');
		$config = Inspector::prepareConfig ( $config, $default, $required );
		
		$client = new self ( $config->get( 'base_url' ),
			$config->get('acct_num'),
      $config->get('oauth_refresh_token'),
			$config->get('email'),
			$config->get('password'),
			$config->get('version')
		);
		$client->setConfig ( $config );
		
		// Add the XML service description to the client
    $path = __DIR__ . DIRECTORY_SEPARATOR . 'rs_guzzle_client_v'. $client->getVersion() . '.xml';
    $client->setDescription(ServiceDescription::factory($path));

		// Keep them cookies
		$client->cookieJar = new IndiscriminateArrayCookieJar();
    $client->getEventDispatcher()->addSubscriber(new CookiePlugin($client->cookieJar));

    $client->getEventDispatcher()->addSubscriber(new HttpAuthenticationPlugin($client));
    $client->getEventDispatcher()->addSubscriber(new ShardAwarenessPlugin($client));

		return $client;
	}
public static function factory ( $ config = array ( ) ) { $ default = array ( 'base_url' => 'https://my.rightscale.com/' , 'version' => '1.0' , 'curl.CURLOPT_FOLLOWLOCATION' => false , 'curl.CURLOPT_RETURNTRANSFER' => true ) ; $ required = array ( 'acct_num' , 'base_url' , 'version' ) ; $ config = Inspector :: prepareConfig ( $ config , $ default , $ required ) ; $ client = new self ( $ config -> get ( 'base_url' ) , $ config -> get ( 'acct_num' ) , $ config -> get ( 'oauth_refresh_token' ) , $ config -> get ( 'email' ) , $ config -> get ( 'password' ) , $ config -> get ( 'version' ) ) ; $ client -> setConfig ( $ config ) ; // Add the XML service description to the client $ path = __DIR__ . DIRECTORY_SEPARATOR . 'rs_guzzle_client_v' . $ client -> getVersion ( ) . '.xml' ; $ client -> setDescription ( ServiceDescription :: factory ( $ path ) ) ; // Keep them cookies $ client -> cookieJar = new IndiscriminateArrayCookieJar ( ) ; $ client -> getEventDispatcher ( ) -> addSubscriber ( new CookiePlugin ( $ client -> cookieJar ) ) ; $ client -> getEventDispatcher ( ) -> addSubscriber ( new HttpAuthenticationPlugin ( $ client ) ) ; $ client -> getEventDispatcher ( ) -> addSubscriber ( new ShardAwarenessPlugin ( $ client ) ) ; return $ client ; }
Factory method to create a new RightScaleClient

Either an oauth_refresh_token or an email/password pair must be supplied for authentication.
If both are supplied the oauth token is preferred

@param array|Collection $config Configuration data. Array keys:
base_url - * Base URL of RightScale API defaults to 'https://my.rightscale.com'
acct_num - * RightScale account number
oauth_refresh_token - RightScale OAuth API Token for authentication
email - RightScale user email address for authentication
password - RightScale user password for authentication
version - * The version of the RightScale API to use.  One of ["1.0", "1.5"], defaults to "1.0"

@return RightScaleClient
Factory method to create a new RightScaleClient