Example #1
0
 /**
  * creates a new ObjectStore object
  *
  * @param OpenCloud\OpenStack $conn a connection object
  * @param string $serviceName the name of the service to use
  * @param string $serviceRegion the name of the service region to use
  * @param string $urltype the type of URL to use (usually "publicURL")
  */
 public function __construct(OpenStack $connection, $serviceName = RAXSDK_OBJSTORE_NAME, $serviceRegion = RAXSDK_OBJSTORE_REGION, $urltype = RAXSDK_OBJSTORE_URLTYPE)
 {
     $this->debug(Lang::translate('initializing ObjectStore...'));
     // call the parent contructor
     parent::__construct($connection, 'object-store', $serviceName, $serviceRegion, $urltype);
     // establish the CDN container, if available
     try {
         $this->cdn = new ObjectStoreCDN($connection, $serviceName . 'CDN', $serviceRegion, $urltype);
     } catch (Exceptions\EndpointError $e) {
         /**
          * if we have an endpoint error, then
          * the CDN functionality is not available
          * In this case, we silently ignore  it.
          */
         $this->cdn = null;
     }
 }
Example #2
0
 /**
  * Creates a new ObjectStoreCDN object
  *
  * This is a simple wrapper function around the parent Service construct,
  * but supplies defaults for the service type.
  *
  * @param OpenStack $conn the connection object
  * @param string $serviceName the name of the service
  * @param string $serviceRegion the service's region
  * @param string $urlType the type of URL (normally 'publicURL')
  */
 public function __construct(OpenStack $connection, $serviceName = RAXSDK_OBJSTORE_NAME, $serviceRegion = RAXSDK_OBJSTORE_REGION, $urltype = RAXSDK_URL_PUBLIC)
 {
     // call the parent contructor
     parent::__construct($connection, 'rax:object-cdn', $serviceName, $serviceRegion, $urltype);
 }