コード例 #1
0
ファイル: CloudFrontApi.php プロジェクト: mheydt/scalr
 /**
  * Loads DistributionConfigData from simple xml object
  *
  * @param   \SimpleXMLElement $sxml
  * @return  DistributionConfigData Returns DistributionConfigData
  */
 protected function _loadDistributionConfigData(\SimpleXMLElement $sxml)
 {
     $item = null;
     if ($this->exist($sxml)) {
         $item = new DistributionConfigData();
         $item->setCloudFront($this->cloudFront);
         $item->aliases = $this->_loadDistributionConfigAliasList($sxml->Aliases);
         $item->cacheBehaviors = $this->_loadCacheBehaviorList($sxml->CacheBehaviors);
         $item->callerReference = $this->exist($sxml->CallerReference) ? (string) $sxml->CallerReference : null;
         $item->comment = $this->exist($sxml->Comment) ? (string) $sxml->Comment : null;
         $item->defaultCacheBehavior = $this->_loadCacheBehaviorData($sxml->DefaultCacheBehavior);
         $item->defaultRootObject = $this->exist($sxml->DefaultRootObject) ? (string) $sxml->DefaultRootObject : null;
         $item->enabled = $this->exist($sxml->Enabled) ? (string) $sxml->Enabled == 'true' : null;
         $item->logging = $this->_loadDistributionConfigLoggingData($sxml->Logging);
         $item->origins = $this->_loadDistributionConfigOriginList($sxml->Origins);
         $item->customErrorResponses = $this->_loadCustomErrorResponseList($sxml->CustomErrorResponses);
         $item->restrictions = $this->_loadGeoRestrictionData($sxml->Restrictions->GeoRestriction);
         $item->viewerCertificate = $this->_loadViewerCertificateData($sxml->ViewerCertificate);
         $item->priceClass = $this->exist($sxml->PriceClass) ? (string) $sxml->PriceClass : null;
         $item->webAclId = $this->exist($sxml->WebACLId) ? (string) $sxml->WebACLId : null;
     }
     return $item;
 }
コード例 #2
0
ファイル: CloudFrontApi.php プロジェクト: recipe/scalr
 /**
  * Loads DistributionConfigData from simple xml object
  *
  * @param   \SimpleXMLElement $sxml
  * @return  DistributionConfigData Returns DistributionConfigData
  */
 protected function _loadDistributionConfigData(\SimpleXMLElement $sxml)
 {
     $item = null;
     if ($this->exist($sxml)) {
         $item = new DistributionConfigData();
         $item->setCloudFront($this->cloudFront);
         $item->aliases = $this->_loadDistributionConfigAliasList($sxml->Aliases);
         $item->cacheBehaviors = $this->_loadCacheBehaviorList($sxml->CacheBehaviors);
         $item->callerReference = $this->exist($sxml->CallerReference) ? (string) $sxml->CallerReference : null;
         $item->comment = $this->exist($sxml->Comment) ? (string) $sxml->Comment : null;
         $item->defaultCacheBehavior = $this->_loadCacheBehaviorData($sxml->DefaultCacheBehavior);
         $item->defaultRootObject = $this->exist($sxml->DefaultRootObject) ? (string) $sxml->DefaultRootObject : null;
         $item->enabled = $this->exist($sxml->Enabled) ? (string) $sxml->Enabled == 'true' : null;
         $item->logging = $this->_loadDistributionConfigLoggingData($sxml->Logging);
         $item->origins = $this->_loadDistributionConfigOriginList($sxml->Origins);
         $item->priceClass = $this->exist($sxml->PriceClass) ? (string) $sxml->PriceClass : null;
     }
     return $item;
 }