当前位置: 首页>>代码示例>>PHP>>正文


PHP kXml::stripXMLInvalidChars方法代码示例

本文整理汇总了PHP中kXml::stripXMLInvalidChars方法的典型用法代码示例。如果您正苦于以下问题:PHP kXml::stripXMLInvalidChars方法的具体用法?PHP kXml::stripXMLInvalidChars怎么用?PHP kXml::stripXMLInvalidChars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kXml的用法示例。


在下文中一共展示了kXml::stripXMLInvalidChars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseOutput

 protected function parseOutput($output)
 {
     $output = kXml::stripXMLInvalidChars($output);
     $tokenizer = new KStringTokenizer($output, "\t\n");
     $mediaInfo = new KalturaMediaInfo();
     $mediaInfo->rawData = $output;
     $fieldCnt = 0;
     $section = self::SrteamGeneral;
     $sectionID = 0;
     $mediaInfo->streamArray = array();
     $streamMediaInfo = null;
     while ($tokenizer->hasMoreTokens()) {
         $tok = strtolower(trim($tokenizer->nextToken()));
         if (strrpos($tok, ":") == false) {
             if (isset($streamMediaInfo)) {
                 $mediaInfo->streamArray[$section][] = $streamMediaInfo;
             }
             $streamMediaInfo = new KalturaMediaInfo();
             $sectionID = strchr($tok, "#");
             if ($sectionID) {
                 $sectionID = trim($sectionID, "#");
             } else {
                 $sectionID = 0;
             }
             if (strstr($tok, self::SrteamGeneral) == true) {
                 $section = self::SrteamGeneral;
             } else {
                 if (strstr($tok, self::SrteamVideo) == true) {
                     $section = self::SrteamVideo;
                 } else {
                     if (strstr($tok, self::SrteamAudio) == true) {
                         $section = self::SrteamAudio;
                     } else {
                         $section = $tok;
                     }
                 }
             }
         } else {
             if ($sectionID <= 1) {
                 self::loadStreamMedia($mediaInfo, $section, $tok);
                 $fieldCnt++;
             }
         }
         self::loadStreamMedia($streamMediaInfo, $section, $tok);
     }
     if (isset($streamMediaInfo)) {
         $mediaInfo->streamArray[$section][] = $streamMediaInfo;
     }
     return $mediaInfo;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:50,代码来源:KMediaInfoMediaParser.php

示例2: parseAction

 /**
  * Parse content of caption asset and index it
  *
  * @action parse
  * @param string $captionAssetId
  * @throws KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND
  */
 function parseAction($captionAssetId)
 {
     $captionAsset = assetPeer::retrieveById($captionAssetId);
     if (!$captionAsset) {
         throw new KalturaAPIException(KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND, $captionAssetId);
     }
     $captionAssetItems = CaptionAssetItemPeer::retrieveByAssetId($captionAssetId);
     foreach ($captionAssetItems as $captionAssetItem) {
         /* @var $captionAssetItem CaptionAssetItem */
         $captionAssetItem->delete();
     }
     // make sure that all old items are deleted from the sphinx before creating the new ones
     kEventsManager::flushEvents();
     $syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $content = kFileSyncUtils::file_get_contents($syncKey, true, false);
     if (!$content) {
         return;
     }
     $captionsContentManager = kCaptionsContentManager::getCoreContentManager($captionAsset->getContainerFormat());
     if (!$captionsContentManager) {
         return;
     }
     $itemsData = $captionsContentManager->parse($content);
     foreach ($itemsData as $itemData) {
         $item = new CaptionAssetItem();
         $item->setCaptionAssetId($captionAsset->getId());
         $item->setEntryId($captionAsset->getEntryId());
         $item->setPartnerId($captionAsset->getPartnerId());
         $item->setStartTime($itemData['startTime']);
         $item->setEndTime($itemData['endTime']);
         $content = '';
         foreach ($itemData['content'] as $curChunk) {
             $content .= $curChunk['text'];
         }
         //Make sure there are no invalid chars in the caption asset items to avoid braking the search request by providing invalid XML
         $content = kString::stripUtf8InvalidChars($content);
         $content = kXml::stripXMLInvalidChars($content);
         $item->setContent($content);
         $item->save();
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:48,代码来源:CaptionAssetItemService.php

示例3: parseOutput

 protected function parseOutput($output)
 {
     $output = kXml::stripXMLInvalidChars($output);
     $tokenizer = new KStringTokenizer($output, "\t\n");
     $mediaInfo = new KalturaMediaInfo();
     $mediaInfo->rawData = $output;
     $fieldCnt = 0;
     $section = self::SrteamGeneral;
     $sectionID = 0;
     $mediaInfo->streamArray = array();
     $streamMediaInfo = null;
     while ($tokenizer->hasMoreTokens()) {
         $tok = strtolower(trim($tokenizer->nextToken()));
         if (strrpos($tok, ":") == false) {
             if (isset($streamMediaInfo)) {
                 $mediaInfo->streamArray[$section][] = $streamMediaInfo;
             }
             $streamMediaInfo = new KalturaMediaInfo();
             $sectionID = strchr($tok, "#");
             if ($sectionID) {
                 $sectionID = trim($sectionID, "#");
             } else {
                 $sectionID = 0;
             }
             if (strstr($tok, self::SrteamGeneral) == true) {
                 $section = self::SrteamGeneral;
             } else {
                 if (strstr($tok, self::SrteamVideo) == true) {
                     $section = self::SrteamVideo;
                 } else {
                     if (strstr($tok, self::SrteamAudio) == true) {
                         $section = self::SrteamAudio;
                     } else {
                         $section = $tok;
                     }
                 }
             }
         } else {
             if ($sectionID <= 1) {
                 self::loadStreamMedia($mediaInfo, $section, $tok);
                 $fieldCnt++;
             }
         }
         self::loadStreamMedia($streamMediaInfo, $section, $tok);
     }
     if (isset($streamMediaInfo)) {
         $mediaInfo->streamArray[$section][] = $streamMediaInfo;
     }
     /*
      * For ARF (webex) files - simulate container ID and format.
      * ARF format considered to be a file that has ARF ext 
      * and DOES NOT have both video and audio setting.
      * On no-content return null
      */
     if (strstr($this->filePath, ".arf")) {
         if ((isset($mediaInfo->audioFormat) || isset($mediaInfo->audioCodecId)) && (isset($mediaInfo->videoFormat) || isset($mediaInfo->videoCodecId))) {
             return $mediaInfo;
         } else {
             $m = new KalturaMediaInfo();
             $m->rawData = $mediaInfo->rawData;
             $m->fileSize = $mediaInfo->fileSize;
             $m->containerFormat = "arf";
             $m->containerId = "arf";
             return $m;
         }
     } else {
         if ($fieldCnt >= 5) {
             return $mediaInfo;
         } else {
             return null;
         }
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:73,代码来源:KMediaInfoMediaParser.php


注:本文中的kXml::stripXMLInvalidChars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。