當前位置: 首頁>>代碼示例>>PHP>>正文


PHP kXml::getXmlAttributeAsString方法代碼示例

本文整理匯總了PHP中kXml::getXmlAttributeAsString方法的典型用法代碼示例。如果您正苦於以下問題:PHP kXml::getXmlAttributeAsString方法的具體用法?PHP kXml::getXmlAttributeAsString怎麽用?PHP kXml::getXmlAttributeAsString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kXml的用法示例。


在下文中一共展示了kXml::getXmlAttributeAsString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getResourceInstance

 /**
  * Returns the right resource instance for the source content of the item
  * @param SimpleXMLElement $elementToSearchIn
  * @param int $conversionProfileId
  * @return KalturaResource - the resource located in the given element
  */
 protected function getResourceInstance(SimpleXMLElement $elementToSearchIn, $conversionProfileId)
 {
     $resource = null;
     if (isset($elementToSearchIn->serverFileContentResource)) {
         if ($this->allowServerResource) {
             KalturaLog::debug("Resource is : serverFileContentResource");
             $resource = new KalturaServerFileResource();
             $localContentResource = $elementToSearchIn->serverFileContentResource;
             $resource->localFilePath = kXml::getXmlAttributeAsString($localContentResource, "filePath");
         } else {
             KalturaLog::err("serverFileContentResource is not allowed");
         }
     } elseif (isset($elementToSearchIn->urlContentResource)) {
         KalturaLog::debug("Resource is : urlContentResource");
         $resource = new KalturaUrlResource();
         $urlContentResource = $elementToSearchIn->urlContentResource;
         $resource->url = kXml::getXmlAttributeAsString($urlContentResource, "url");
     } elseif (isset($elementToSearchIn->sshUrlContentResource)) {
         KalturaLog::debug("Resource is : sshUrlContentResource");
         $resource = new KalturaSshUrlResource();
         $sshUrlContentResource = $elementToSearchIn->sshUrlContentResource;
         $resource->url = kXml::getXmlAttributeAsString($sshUrlContentResource, "url");
         $resource->keyPassphrase = kXml::getXmlAttributeAsString($sshUrlContentResource, "keyPassphrase");
         $resource->privateKey = strval($sshUrlContentResource->privateKey);
         $resource->publicKey = strval($sshUrlContentResource->publicKey);
     } elseif (isset($elementToSearchIn->remoteStorageContentResource)) {
         KalturaLog::debug("Resource is : remoteStorageContentResource");
         $resource = new KalturaRemoteStorageResource();
         $remoteContentResource = $elementToSearchIn->remoteStorageContentResource;
         $resource->url = kXml::getXmlAttributeAsString($remoteContentResource, "url");
         $resource->storageProfileId = $this->getStorageProfileId($remoteContentResource);
     } elseif (isset($elementToSearchIn->remoteStorageContentResources)) {
         KalturaLog::debug("Resource is : remoteStorageContentResources");
         $resource = new KalturaRemoteStorageResources();
         $resource->resources = array();
         $remoteContentResources = $elementToSearchIn->remoteStorageContentResources;
         foreach ($remoteContentResources->remoteStorageContentResource as $remoteContentResource) {
             /* @var $remoteContentResource SimpleXMLElement */
             KalturaLog::debug("Resources name [" . $remoteContentResource->getName() . "] url [" . $remoteContentResource['url'] . "] storage [{$remoteContentResource->storageProfile}]");
             $childResource = new KalturaRemoteStorageResource();
             $childResource->url = kXml::getXmlAttributeAsString($remoteContentResource, "url");
             $childResource->storageProfileId = $this->getStorageProfileId($remoteContentResource);
             $resource->resources[] = $childResource;
         }
     } elseif (isset($elementToSearchIn->entryContentResource)) {
         KalturaLog::debug("Resource is : entryContentResource");
         $resource = new KalturaEntryResource();
         $entryContentResource = $elementToSearchIn->entryContentResource;
         $resource->entryId = kXml::getXmlAttributeAsString($entryContentResource, "entryId");
         $resource->flavorParamsId = $this->getFlavorParamsId($entryContentResource, $conversionProfileId, false);
     } elseif (isset($elementToSearchIn->assetContentResource)) {
         KalturaLog::debug("Resource is : assetContentResource");
         $resource = new KalturaAssetResource();
         $assetContentResource = $elementToSearchIn->assetContentResource;
         $resource->assetId = kXml::getXmlAttributeAsString($assetContentResource, "assetId");
     }
     return $resource;
 }
開發者ID:kubrickfr,項目名稱:server,代碼行數:64,代碼來源:BulkUploadEngineXml.php


注:本文中的kXml::getXmlAttributeAsString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。