本文整理汇总了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;
}