public static function newFromServiceCatalog($catalog, $authToken, $region) {
    $c = count($catalog);
    for ($i = 0; $i < $c; ++$i) {
      if ($catalog[$i]['type'] == self::SERVICE_TYPE) {
        foreach ($catalog[$i]['endpoints'] as $endpoint) {
          if (isset($endpoint['publicURL']) && $endpoint['region'] == $region) {
            $os= new ObjectStorage($authToken, $endpoint['publicURL']);

            return $os;
          }
        }
      }
    }

    return FALSE;
  }
public static function newFromServiceCatalog($catalog, $authToken, $region) {
    $c = count($catalog);
    for ($i = 0; $i < $c; ++$i) {
      if ($catalog[$i]['type'] == self::SERVICE_TYPE) {
        foreach ($catalog[$i]['endpoints'] as $endpoint) {
          if (isset($endpoint['publicURL']) && $endpoint['region'] == $region) {
            $os= new ObjectStorage($authToken, $endpoint['publicURL']);

            return $os;
          }
        }
      }
    }

    return FALSE;
  }
public static function newFromServiceCatalog ( $ catalog , $ authToken , $ region ) { $ c = count ( $ catalog ) ; for ( $ i = 0 ; $ i < $ c ; ++ $ i ) { if ( $ catalog [ $ i ] [ 'type' ] == self :: SERVICE_TYPE ) { foreach ( $ catalog [ $ i ] [ 'endpoints' ] as $ endpoint ) { if ( isset ( $ endpoint [ 'publicURL' ] ) && $ endpoint [ 'region' ] == $ region ) { $ os = new ObjectStorage ( $ authToken , $ endpoint [ 'publicURL' ] ) ; return $ os ; } } } } return FALSE ; }
Given a service catalog and an token, create an ObjectStorage instance.

The IdentityServices object contains a service catalog listing all of the
services to which the present account has access.

This builder can scan the catalog and generate a new ObjectStorage
instance pointed to the first object storage endpoint in the catalog.

@param array $catalog
The serice catalog from IdentityServices::serviceCatalog(). This
can be either the entire catalog or a catalog filtered to
just ObjectStorage::SERVICE_TYPE.
@param string $authToken
The auth token returned by IdentityServices.
@param string $region
The region being used for this service.

@retval HPCloud::Storage::ObjectStorage
@return \HPCloud\Storage\ObjectStorage
A new ObjectStorage instance.
Given a service catalog and an token create an ObjectStorage instance .