public function __construct(CF_Container $container, $webDir, $ttl, dmMimeTypeResolver $mimeTypeResolver, sfEventDispatcher $dispatcher = null)
 {
     $this->container = $container;
     $this->webDir = $webDir;
     $this->uri = $container->make_public($ttl);
     $this->mimeTypeResolver = $mimeTypeResolver;
     $this->dispatcher = $dispatcher;
 }
示例#2
0
 /**
  * Enable Container content to be served via CDN or modify CDN attributes
  *
  * Either enable this Container's content to be served via CDN or
  * adjust its CDN attributes.  This Container will always return the
  * same CDN-enabled URI each time it is toggled public/private/public.
  *
  * Example:
  * <code>
  * # ... authentication code excluded (see previous examples) ...
  * #
  * $conn = new CF_Connection($auth);
  *
  * $public_container = $conn->create_container("public");
  *
  * # CDN-enable the container and set it's TTL for a month
  * #
  * $public_container->make_public(86400/2); # 12 hours (86400 seconds/day)
  * </code>
  *
  * @param int $ttl the time in seconds content will be cached in the CDN
  * @returns string the CDN enabled Container's URI
  * @throws CDNNotEnabledException CDN functionality not returned during auth
  * @throws AuthenticationException if auth token is not valid/expired
  * @throws InvalidResponseException unexpected response
  */
 function make_public($ttl = 86400)
 {
     $this->initContainer();
     return parent::make_public($ttl);
 }