当前位置: 首页>>代码示例>>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;未经允许,请勿转载。