public static function newFromResponse($name, $response, $token, $url) {
    $container = new Container($name);
    $container->bytes = $response->header('X-Container-Bytes-Used', 0);
    $container->count = $response->header('X-Container-Object-Count', 0);
    $container->baseUrl = $url;
    $container->url = $url . '/' . rawurlencode($name);
    $container->token = $token;

    $container->acl = ACL::newFromHeaders($response->headers());

    $prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
    $metadata = Container::extractHeaderAttributes($response->headers(), $prefix);
    $container->setMetadata($metadata);

    return $container;
  }
public static function newFromResponse($name, $response, $token, $url) {
    $container = new Container($name);
    $container->bytes = $response->header('X-Container-Bytes-Used', 0);
    $container->count = $response->header('X-Container-Object-Count', 0);
    $container->baseUrl = $url;
    $container->url = $url . '/' . rawurlencode($name);
    $container->token = $token;

    $container->acl = ACL::newFromHeaders($response->headers());

    $prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
    $metadata = Container::extractHeaderAttributes($response->headers(), $prefix);
    $container->setMetadata($metadata);

    return $container;
  }
public static function newFromResponse ( $ name , $ response , $ token , $ url ) { $ container = new Container ( $ name ) ; $ container -> bytes = $ response -> header ( 'X-Container-Bytes-Used' , 0 ) ; $ container -> count = $ response -> header ( 'X-Container-Object-Count' , 0 ) ; $ container -> baseUrl = $ url ; $ container -> url = $ url . '/' . rawurlencode ( $ name ) ; $ container -> token = $ token ; $ container -> acl = ACL :: newFromHeaders ( $ response -> headers ( ) ) ; $ prefix = Container :: CONTAINER_METADATA_HEADER_PREFIX ; $ metadata = Container :: extractHeaderAttributes ( $ response -> headers ( ) , $ prefix ) ; $ container -> setMetadata ( $ metadata ) ; return $ container ; }
Given an OpenStack HTTP response, build a Container.

This factory is intended for use by low-level libraries. In most
cases, the standard constructor is preferred for client-size
Container initialization.

@param string $name
The name of the container.
@param object $response HPCloud::Transport::Response
The HTTP response object from the Transporter layer
@param string $token
The auth token.
@param string $url
The base URL. The container name is automatically appended to
this at construction time.
@retval HPCloud::Storage::ObjectStorage::Container
@return \HPCloud\Storage\ObjectStorage\Container
The Container object, initialized and ready for use.
Given an OpenStack HTTP response build a Container .