public function enable($name, $ttl = NULL, &$created = FALSE) {
    $headers = array();
    if (!empty($ttl)) {
      $headers['X-TTL'] = (int) $ttl;
    }
    $res = $this->modifyContainer($name, 'PUT', $headers);
    $created = $res->status() == 201;

    $url = $res->header('X-Cdn-Uri', 'UNKNOWN');
    return $url;
  }
public function enable($name, $ttl = NULL, &$created = FALSE) {
    $headers = array();
    if (!empty($ttl)) {
      $headers['X-TTL'] = (int) $ttl;
    }
    $res = $this->modifyContainer($name, 'PUT', $headers);
    $created = $res->status() == 201;

    $url = $res->header('X-Cdn-Uri', 'UNKNOWN');
    return $url;
  }
public function enable ( $ name , $ ttl = NULL , & $ created = FALSE ) { $ headers = array ( ) ; if ( ! empty ( $ ttl ) ) { $ headers [ 'X-TTL' ] = ( int ) $ ttl ; } $ res = $ this -> modifyContainer ( $ name , 'PUT' , $ headers ) ; $ created = $ res -> status ( ) == 201 ; $ url = $ res -> header ( 'X-Cdn-Uri' , 'UNKNOWN' ) ; return $ url ; }
Enable a container.

This adds the container to the CDN service and turns on caching.

In the CDN API, there are two meanings for the term "enable":

1. To "CDN-enable" a container means to add that container to the CDN
service. There is no "CDN-disable".
2. To "enable" a container means to cache that container's
content in a publically available CDN server. There is also a
way to "disable" in this sense -- which blocks a container from
caching.

This method does the first -- it adds a container to the CDN
service. It so happens that adding a container also enables (in the
second sense) the
container. (This is a feature of the remote service, not the API).

Enabling and disabling (in the second sense) are considered temporary operations
to switch on and off caching on a particular container. Both of
these operations are done with the update() method.

The endpoint is supposed to return different results based on the above;
accordingly this method should return TRUE if the container was added
to the list, and FALSE if it was already there. HOWEVER, in some versions
of the CDN service the endpoint returns the same code for both operations,
so the result cannot be relied upon.

@param string $name
The name of the container.
@param int $ttl
Time to live.
The number of seconds an object may stay in the cache. This is the
maximum amount of time. There is, however, no assurance that the object
will remain for the full TTL. 15 minutes is the minimum time. Five years
is the max.
@param boolean $created
If this is passed, then its value will be set to TRUE if the
container was created in the CDN, or FALSE if the container
already existed in CDN.
@retval string
@return string
TRUE if the container was created, FALSE if the container was already
added to the CDN (and thus nothing happened).
@throws HPCloud::Exception
Several HTTP-level exceptions can be thrown.
@see http://api-docs.hpcloud.com/hpcloud-cdn-storage/1.0/content/cdn-enable-container.html
Enable a container .