public static function newFromSwiftAuth($account, $key, $url) {
    $headers = array(
      'X-Auth-User' => $account,
      'X-Auth-Key' => $key,
    );

    $client = \HPCloud\Transport::instance();

    // This will throw an exception if it cannot connect or
    // authenticate.
    $res = $client->doRequest($url, 'GET', $headers);


    // Headers that come back:
    // X-Storage-Url: https://region-a.geo-1.objects.hpcloudsvc.com:443/v1/AUTH_d8e28d35-3324-44d7-a625-4e6450dc1683
    // X-Storage-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba
    // X-Auth-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba
    // X-Trans-Id: tx33f1257e09f64bc58f28e66e0577268a


    $token = $res->header('X-Auth-Token');
    $newUrl = $res->header('X-Storage-Url');


    $store = new ObjectStorage($token, $newUrl);

    return $store;
  }
public static function newFromSwiftAuth($account, $key, $url) {
    $headers = array(
      'X-Auth-User' => $account,
      'X-Auth-Key' => $key,
    );

    $client = \HPCloud\Transport::instance();

    // This will throw an exception if it cannot connect or
    // authenticate.
    $res = $client->doRequest($url, 'GET', $headers);


    // Headers that come back:
    // X-Storage-Url: https://region-a.geo-1.objects.hpcloudsvc.com:443/v1/AUTH_d8e28d35-3324-44d7-a625-4e6450dc1683
    // X-Storage-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba
    // X-Auth-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba
    // X-Trans-Id: tx33f1257e09f64bc58f28e66e0577268a


    $token = $res->header('X-Auth-Token');
    $newUrl = $res->header('X-Storage-Url');


    $store = new ObjectStorage($token, $newUrl);

    return $store;
  }
public static function newFromSwiftAuth ( $ account , $ key , $ url ) { $ headers = array ( 'X-Auth-User' => $ account , 'X-Auth-Key' => $ key , ) ; $ client = \ HPCloud \ Transport :: instance ( ) ; // This will throw an exception if it cannot connect or // authenticate. $ res = $ client -> doRequest ( $ url , 'GET' , $ headers ) ; // Headers that come back: // X-Storage-Url: https://region-a.geo-1.objects.hpcloudsvc.com:443/v1/AUTH_d8e28d35-3324-44d7-a625-4e6450dc1683 // X-Storage-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba // X-Auth-Token: AUTH_tkd2ffb4dac4534c43afbe532ca41bcdba // X-Trans-Id: tx33f1257e09f64bc58f28e66e0577268a $ token = $ res -> header ( 'X-Auth-Token' ) ; $ newUrl = $ res -> header ( 'X-Storage-Url' ) ; $ store = new ObjectStorage ( $ token , $ newUrl ) ; return $ store ; }
Create a new instance after getting an authenitcation token.

THIS METHOD IS DEPRECATED. OpenStack now uses Keyston to authenticate.
You should use HPCloud::Services::IdentityServices to authenticate.
Then use this class's constructor to create an object.

This uses the legacy Swift authentication facility to authenticate
to swift, get a new token, and then create a new ObjectStorage
instance with that token.

To use the legacy Object Storage authentication mechanism, you will
need the follwing pieces of information:

- Account ID: Your account username or ID. For HP Cloud customers,
this is typically a long string of numbers and letters.
- Key: Your secret key. For HP Customers, this is a string of
random letters and numbers.
- Endpoint URL: The URL given to you by your service provider.

HP Cloud users can find all of this information on your Object
Storage account dashboard.

@param string $account
Your account name.
@param string $key
Your secret key.
@param string $url
The URL to the object storage endpoint.

@throws HPCloud::Transport::AuthorizationException if the
authentication failed.
@throws HPCloud::Transport::FileNotFoundException if the URL is
wrong.
@throws HPCloud::Exception if some other exception occurs.

@deprecated Newer versions of OpenStack use Keystone auth instead
of Swift auth.
Create a new instance after getting an authenitcation token .