• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP kXml类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: watchFolder

 public function watchFolder(KalturaDropFolder $folder)
 {
     $this->dropFolder = $folder;
     $this->fileTransferMgr = self::getFileTransferManager($this->dropFolder);
     KalturaLog::info('Watching folder [' . $this->dropFolder->id . ']');
     $physicalFiles = $this->getDropFolderFilesFromPhysicalFolder();
     if (count($physicalFiles) > 0) {
         $dropFolderFilesMap = $this->loadDropFolderFiles();
     } else {
         $dropFolderFilesMap = array();
     }
     $maxModificationTime = 0;
     foreach ($physicalFiles as &$physicalFile) {
         /* @var $physicalFile FileObject */
         $physicalFileName = $physicalFile->filename;
         $utfFileName = kString::stripUtf8InvalidChars($physicalFileName);
         if ($physicalFileName != $utfFileName) {
             KalturaLog::info("File name [{$physicalFileName}] is not utf-8 compatible, Skipping file...");
             continue;
         }
         if (!kXml::isXMLValidContent($utfFileName)) {
             KalturaLog::info("File name [{$physicalFileName}] contains invalid XML characters, Skipping file...");
             continue;
         }
         if ($this->dropFolder->incremental && $physicalFile->modificationTime < $this->dropFolder->lastFileTimestamp) {
             KalturaLog::info("File modification time [" . $physicalFile->modificationTime . "] predates drop folder last timestamp [" . $this->dropFolder->lastFileTimestamp . "]. Skipping.");
             if (isset($dropFolderFilesMap[$physicalFileName])) {
                 unset($dropFolderFilesMap[$physicalFileName]);
             }
             continue;
         }
         if ($this->validatePhysicalFile($physicalFileName)) {
             $maxModificationTime = $physicalFile->modificationTime > $maxModificationTime ? $physicalFile->modificationTime : $maxModificationTime;
             KalturaLog::info('Watch file [' . $physicalFileName . ']');
             if (!array_key_exists($physicalFileName, $dropFolderFilesMap)) {
                 try {
                     $lastModificationTime = $physicalFile->modificationTime;
                     $fileSize = $physicalFile->fileSize;
                     $this->handleFileAdded($physicalFileName, $fileSize, $lastModificationTime);
                 } catch (Exception $e) {
                     KalturaLog::err("Error handling drop folder file [{$physicalFileName}] " . $e->getMessage());
                 }
             } else {
                 $dropFolderFile = $dropFolderFilesMap[$physicalFileName];
                 //if file exist in the folder remove it from the map
                 //all the files that are left in a map will be marked as PURGED
                 unset($dropFolderFilesMap[$physicalFileName]);
                 $this->handleExistingDropFolderFile($dropFolderFile);
             }
         }
     }
     foreach ($dropFolderFilesMap as $dropFolderFile) {
         $this->handleFilePurged($dropFolderFile->id);
     }
     if ($this->dropFolder->incremental && $maxModificationTime > $this->dropFolder->lastFileTimestamp) {
         $updateDropFolder = new KalturaDropFolder();
         $updateDropFolder->lastFileTimestamp = $maxModificationTime;
         $this->dropFolderPlugin->dropFolder->update($this->dropFolder->id, $updateDropFolder);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:60,代码来源:KDropFolderFileTransferEngine.php


示例2: fromXml

 /**	
  * 
  * Generates a new KalturaTestsFailures object from a given failure file path 
  * @param string $failureFilePath
  */
 public function fromXml($failureFilePath)
 {
     $simpleXML = kXml::openXmlFile($failureFilePath);
     foreach ($simpleXML->Failures->UnitTestFailures as $unitTestFailureXml) {
         $this->testCaseFailures[] = KalturaTestCaseFailure::generateFromXml($unitTestFailureXml);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:KalturaTestFailures.php


示例3: fromSourceXML

 /**
  * sets the KalturaDataGeneratorConfigFile object from simpleXMLElement (the source xml of the data)
  * @param SimpleXMLElement $simpleXMLElement
  * 
  * @return None, sets the given object
  */
 public function fromSourceXML(SimpleXMLElement $simpleXMLElement)
 {
     //For each test file
     foreach ($simpleXMLElement->TestDataFile as $xmlTestDataFile) {
         //Create new test file obejct
         $testDataFile = new KalturaUnitTestDataFile();
         //For each UnitTest data (in this file)
         foreach ($xmlTestDataFile->UnitTestsData->UnitTestData as $xmlUnitTestData) {
             //Create new unit test data
             $unitTestData = new KalturaUnitTestData();
             //For each input create the needed Kaltura object identifier
             foreach ($xmlUnitTestData->Inputs->Input as $input) {
                 $additionalData = kXml::getAttributesAsArray($input);
                 $unitTestDataObjectIdentifier = new KalturaUnitTestDataObject((string) $input["type"], $additionalData);
                 $unitTestData->input[] = $unitTestDataObjectIdentifier;
             }
             //And for each output reference create the needed kaltura object identifier
             foreach ($xmlUnitTestData->OutputReferences->OutputReference as $outputReference) {
                 $additionalData = kXml::getAttributesAsArray($outputReference);
                 $unitTestDataObjectIdentifier = new KalturaUnitTestDataObject((string) $outputReference["type"], $additionalData);
                 $unitTestData->outputReference[] = $unitTestDataObjectIdentifier;
             }
             //Add the new unit test into the tests array.
             $testDataFile->unitTestsData[] = $unitTestData;
         }
         $testDataFile->fileName = trim((string) $xmlTestDataFile->FileName);
         $this->testFiles[] = $testDataFile;
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:35,代码来源:KalturaDataGeneratorConfigFile.php


示例4: parseStrTTTime

 private function parseStrTTTime($timeStr)
 {
     $matches = null;
     if (preg_match('/(\\d+)s/', $timeStr)) {
         return intval($matches[1]) * 1000;
     }
     return kXml::timeToInteger($timeStr);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:8,代码来源:dfxpCaptionsContentManager.php


示例5: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     $kshow_id = @$_REQUEST["kshow_id"];
     $this->kshow_id = $kshow_id;
     $this->kshow = NULL;
     $entry_id = @$_REQUEST["entry_id"];
     $this->entry_id = $entry_id;
     $this->entry = NULL;
     $this->message = "";
     if (!empty($kshow_id)) {
         $this->kshow = kshowPeer::retrieveByPK($kshow_id);
         if (!$this->kshow) {
             $this->message = "Cannot find kshow [{$kshow_id}]";
         } else {
             $this->entry = $this->kshow->getShowEntry();
         }
     } elseif (!empty($kshow_id)) {
         $this->entry = entryPeer::retrieveByPK($entry_id);
         if (!$this->entry) {
             $this->message = "Cannot find entry [{$entry_id}]";
         } else {
             $this->kshow = $this->{$this}->entry->getKshow();
         }
     }
     if ($this->kshow) {
         $this->metadata = $this->kshow->getMetadata();
     } else {
         $this->metadata = "";
     }
     $pending_str = $this->getP("pending");
     $remove_pending = $this->getP("remove_pending");
     if ($this->metadata && ($remove_pending || $pending_str)) {
         if ($remove_pending) {
             $pending_str = "";
         }
         $xml_doc = new DOMDocument();
         $xml_doc->loadXML($this->metadata);
         $metadata = kXml::getFirstElement($xml_doc, "MetaData");
         $should_save = kXml::setChildElement($xml_doc, $metadata, "Pending", $pending_str, true);
         if ($remove_pending) {
             $should_save = kXml::setChildElement($xml_doc, $metadata, "LastPendingTimeStamp", "", true);
         }
         if ($should_save) {
             $fixed_content = $xml_doc->saveXML();
             $content_dir = myContentStorage::getFSContentRootPath();
             $file_name = realpath($content_dir . $this->entry->getDataPath());
             $res = file_put_contents($file_name, $fixed_content);
             // sync - NOTOK
             $this->metadata = $fixed_content;
         }
     }
     $this->pending = $pending_str;
     $this->kshow_id = $kshow_id;
     $this->entry_id = $entry_id;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:56,代码来源:editPendingAction.class.php


示例6: handleFooter

 public function handleFooter()
 {
     $mrss = $this->getKalturaMrssXml($this->syndicationFeed->name, $this->syndicationFeed->feedLandingPage, $this->syndicationFeed->feedDescription);
     if ($this->kalturaXslt) {
         $mrss = kXml::transformXmlUsingXslt($mrss, $this->kalturaXslt);
     }
     $divideHeaderFromFooter = strpos($mrss, self::ITEMS_PLACEHOLDER) + strlen(self::ITEMS_PLACEHOLDER);
     $mrss = substr($mrss, $divideHeaderFromFooter);
     return $mrss;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:10,代码来源:KalturaFeedRenderer.php


示例7: fromXml

 /**
  * 
  * Generates a new testCaseFailure object from a given simpleXmlElement (failure file xml)
  * @param SimpleXMlElement $unitTestFailureXml
  */
 public function fromXml(SimpleXMlElement $unitTestFailureXml)
 {
     //Sets the inputs as key => value byt the xml attributes
     foreach ($unitTestFailureXml->Inputs->Input as $inputXml) {
         $this->testCaseInput[] = kXml::getAttributesAsArray($inputXml);
     }
     foreach ($unitTestFailureXml->Failures->Failure as $failureXml) {
         $this->testCaseFailures[] = KalturaFailure::generateFromXml($failureXml);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:15,代码来源:KalturaTestCaseFailure.php


示例8: validateXsdData

 public static function validateXsdData($xsdData, &$errorMessage)
 {
     // validates the xsd
     libxml_use_internal_errors(true);
     libxml_clear_errors();
     $xml = new KDOMDocument();
     if (!$xml->loadXML($xsdData)) {
         $errorMessage = kXml::getLibXmlErrorDescription($xsdData);
         return false;
     }
     libxml_clear_errors();
     libxml_use_internal_errors(false);
     return true;
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:kMetadataProfileManager.php


示例9: 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


示例10: doTest

 public function doTest($xmlPath, $type)
 {
     echo "\tTesting File [{$xmlPath}]\n";
     $serviceUrl = $this->client->getConfig()->serviceUrl;
     $xsdPath = "{$serviceUrl}/api_v3/index.php/service/schema/action/serve/type/{$type}";
     //		libxml_use_internal_errors(true);
     //		libxml_clear_errors();
     $doc = new DOMDocument();
     $doc->Load($xmlPath);
     //Validate the XML file against the schema
     if (!$doc->schemaValidate($xsdPath)) {
         $description = kXml::getLibXmlErrorDescription(file_get_contents($xmlPath));
         $this->fail("Type [{$type}] File [{$xmlPath}]: {$description}");
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:SchemaServiceTestValidate.php


示例11: getAllAssetsData

 public static function getAllAssetsData($filePath)
 {
     list($xml_doc, $xpath) = self::getDomAndXpath($filePath);
     $asset_ids = self::getElementsList($xpath, "*");
     //$asset_ids = $xpath->query( "//VideoAssets/vidAsset" );
     $arr = array();
     foreach ($asset_ids as $asset_id) {
         $node = array();
         $node["id"] = $asset_id->getAttribute("k_id");
         $stream_info_elem = kXml::getFirstElement($asset_id, "StreamInfo");
         $node["start_time"] = $stream_info_elem->getAttribute("start_time");
         $node["len_time"] = $stream_info_elem->getAttribute("len_time");
         //start_time="0" len_time=
         $arr[] = $node;
     }
     return $arr;
 }
开发者ID:GElkayam,项目名称:server,代码行数:17,代码来源:myFlvStreamer.class.php


示例12: parseCuePoint

 protected function parseCuePoint(SimpleXMLElement $scene)
 {
     if ($scene->getName() != 'scene-code-cue-point') {
         return null;
     }
     $cuePoint = parent::parseCuePoint($scene);
     if (!$cuePoint instanceof KalturaCodeCuePoint) {
         return null;
     }
     if (isset($scene->sceneEndTime)) {
         $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime);
     }
     if (isset($scene->code)) {
         $cuePoint->code = "{$scene->code}";
     }
     if (isset($scene->description)) {
         $cuePoint->description = "{$scene->description}";
     }
     return $cuePoint;
 }
开发者ID:DBezemer,项目名称:server,代码行数:20,代码来源:CodeCuePointBulkUploadXmlHandler.php


示例13: 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


示例14: parseCuePoint

 protected function parseCuePoint(SimpleXMLElement $scene)
 {
     if ($scene->getName() != 'scene-annotation') {
         return null;
     }
     $cuePoint = parent::parseCuePoint($scene);
     if (!$cuePoint instanceof KalturaAnnotation) {
         return null;
     }
     if (isset($scene->sceneEndTime)) {
         $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime);
     }
     if (isset($scene->sceneText)) {
         $cuePoint->text = "{$scene->sceneText}";
     }
     if (isset($scene->parentId)) {
         $cuePoint->parentId = "{$scene->parentId}";
     } elseif (isset($scene->parent)) {
         $cuePoint->parentId = $this->getCuePointId("{$scene->parent}");
     }
     return $cuePoint;
 }
开发者ID:DBezemer,项目名称:server,代码行数:22,代码来源:AnnotationBulkUploadXmlHandler.php


示例15: parseCuePoint

 protected function parseCuePoint(SimpleXMLElement $scene)
 {
     if ($scene->getName() != 'scene-ad-cue-point') {
         return null;
     }
     $cuePoint = parent::parseCuePoint($scene);
     if (!$cuePoint instanceof KalturaAdCuePoint) {
         return null;
     }
     if (isset($scene->sceneEndTime)) {
         $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime);
     }
     if (isset($scene->sceneTitle)) {
         $cuePoint->title = "{$scene->sceneTitle}";
     }
     if (isset($scene->sourceUrl)) {
         $cuePoint->sourceUrl = "{$scene->sourceUrl}";
     }
     $cuePoint->adType = "{$scene->adType}";
     $cuePoint->protocolType = "{$scene->protocolType}";
     return $cuePoint;
 }
开发者ID:DBezemer,项目名称:server,代码行数:22,代码来源:AdCuePointBulkUploadXmlHandler.php


示例16: addFromFileAction

 /**
  * Allows you to add a metadata profile object and metadata profile file associated with Kaltura object type
  * 
  * @action addFromFile
  * @param KalturaMetadataProfile $metadataProfile
  * @param file $xsdFile XSD metadata definition
  * @param file $viewsFile UI views definition
  * @return KalturaMetadataProfile
  * @throws MetadataErrors::METADATA_FILE_NOT_FOUND
  */
 function addFromFileAction(KalturaMetadataProfile $metadataProfile, $xsdFile, $viewsFile = null)
 {
     $filePath = $xsdFile['tmp_name'];
     if (!file_exists($filePath)) {
         throw new KalturaAPIException(MetadataErrors::METADATA_FILE_NOT_FOUND, $xsdFile['name']);
     }
     // validates the xsd
     libxml_use_internal_errors(true);
     libxml_clear_errors();
     $xml = new KDOMDocument();
     if (!$xml->load($filePath)) {
         $errorMessage = kXml::getLibXmlErrorDescription(file_get_contents($xsdFile));
         throw new KalturaAPIException(MetadataErrors::INVALID_METADATA_PROFILE_SCHEMA, $errorMessage);
     }
     libxml_clear_errors();
     libxml_use_internal_errors(false);
     // must be validatebefore checking available searchable fields count
     $metadataProfile->validatePropertyNotNull('metadataObjectType');
     kMetadataManager::validateMetadataProfileField($this->getPartnerId(), $xsdFile, false, $metadataProfile->metadataObjectType);
     $dbMetadataProfile = $metadataProfile->toInsertableObject();
     $dbMetadataProfile->setStatus(KalturaMetadataProfileStatus::ACTIVE);
     $dbMetadataProfile->setPartnerId($this->getPartnerId());
     $dbMetadataProfile->save();
     $key = $dbMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_DEFINITION);
     kFileSyncUtils::moveFromFile($filePath, $key);
     if ($viewsFile && $viewsFile['size']) {
         $filePath = $viewsFile['tmp_name'];
         if (!file_exists($filePath)) {
             throw new KalturaAPIException(MetadataErrors::METADATA_FILE_NOT_FOUND, $viewsFile['name']);
         }
         $key = $dbMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_VIEWS);
         kFileSyncUtils::moveFromFile($filePath, $key);
     }
     kMetadataManager::parseProfileSearchFields($this->getPartnerId(), $dbMetadataProfile);
     $metadataProfile = new KalturaMetadataProfile();
     $metadataProfile->fromObject($dbMetadataProfile);
     return $metadataProfile;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:48,代码来源:MetadataProfileService.php


示例17: syndicate

 public static function syndicate(CuePoint $cuePoint, SimpleXMLElement $scenes, SimpleXMLElement $scene = null)
 {
     if (!$cuePoint instanceof Annotation) {
         return $scene;
     }
     if (!$scene) {
         $scene = kCuePointManager::syndicateCuePointXml($cuePoint, $scenes->addChild('scene-annotation'));
     }
     $scene->addChild('sceneEndTime', kXml::integerToTime($cuePoint->getEndTime()));
     if ($cuePoint->getText()) {
         $scene->addChild('sceneText', kMrssManager::stringToSafeXml($cuePoint->getText()));
     }
     if ($cuePoint->getParentId()) {
         $parentCuePoint = CuePointPeer::retrieveByPK($cuePoint->getParentId());
         if ($parentCuePoint) {
             if ($parentCuePoint->getSystemName()) {
                 $scene->addChild('parent', kMrssManager::stringToSafeXml($parentCuePoint->getSystemName()));
             }
             $scene->addChild('parentId', $parentCuePoint->getId());
         }
     }
     return $scene;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:23,代码来源:AnnotationPlugin.php


示例18: generateXml

 /**
  * @param array<CuePoint> $cuePoints
  * @return string xml
  */
 public static function generateXml(array $cuePoints)
 {
     $schemaType = CuePointPlugin::getApiValue(CuePointSchemaType::SERVE_API);
     $xsdUrl = "http://" . kConf::get('cdn_host') . "/api_v3/service/schema/action/serve/type/{$schemaType}";
     $scenes = new SimpleXMLElement('<scenes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="' . $xsdUrl . '" />');
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaCuePointXmlParser');
     foreach ($cuePoints as $cuePoint) {
         $scene = null;
         foreach ($pluginInstances as $pluginInstance) {
             $scene = $pluginInstance->generateXml($cuePoint, $scenes, $scene);
         }
     }
     $xmlContent = $scenes->asXML();
     $xml = new KDOMDocument();
     libxml_use_internal_errors(true);
     libxml_clear_errors();
     if (!$xml->loadXML($xmlContent)) {
         $errorMessage = kXml::getLibXmlErrorDescription($xmlContent);
         throw new kCuePointException("XML is invalid:\n{$errorMessage}", kCuePointException::XML_INVALID);
     }
     $xsdPath = SchemaService::getSchemaPath($schemaType);
     libxml_clear_errors();
     if (!$xml->schemaValidate($xsdPath)) {
         $errorMessage = kXml::getLibXmlErrorDescription($xmlContent);
         throw new kCuePointException("XML is invalid:\n{$errorMessage}", kCuePointException::XML_INVALID);
     }
     return $xmlContent;
 }
开发者ID:dozernz,项目名称:server,代码行数:32,代码来源:kCuePointManager.php


示例19: provider

 /**
  * 
  * The test data provider (gets the data for the different tests)
  * @param string $className - The class name
  * @param string $procedureName - The current method (test) name
  * @return array<array>();
  */
 public function provider($className, $procedureName)
 {
     //print("In provider for $className, $procedureName \n");
     //Gets from the given class the class data file
     $class = get_class($this);
     $classFilePath = KAutoloader::getClassFilePath($class);
     $testClassDir = dirname($classFilePath);
     $dataFilePath = $testClassDir . DIRECTORY_SEPARATOR . "testsData/{$className}.data";
     KalturaLog::debug("The data file path [" . $dataFilePath . "]");
     if (file_exists($dataFilePath)) {
         $simpleXML = kXml::openXmlFile($dataFilePath);
     } else {
         //TODO: Give notice or create the file don't throw an exception
         throw new Exception("Data file [{$dataFilePath}] not found");
     }
     $inputsForTestProcedure = array();
     foreach ($simpleXML->TestProcedureData as $xmlTestProcedureData) {
         if ($xmlTestProcedureData["testProcedureName"] != $procedureName) {
             continue;
         }
         foreach ($xmlTestProcedureData->TestCaseData as $xmlTestCaseData) {
             $testCaseInstanceInputs = array();
             foreach ($xmlTestCaseData->Input as $input) {
                 $object = KalturaTestDataObject::generatefromXml($input);
                 //Add the new input to the test case instance data
                 $testCaseInstanceInputs[] = $object;
             }
             foreach ($xmlTestCaseData->OutputReference as $output) {
                 $object = KalturaTestDataObject::generatefromXml($output);
                 //Add the new output reference to the test case instance data
                 $testCaseInstanceInputs[] = $object;
             }
             //Add the test case into the test procedure data
             $inputsForTestProcedure[] = $testCaseInstanceInputs;
         }
     }
     KalturaLog::info("Tests data provided Before transformation to objects: \n[" . print_r($inputsForTestProcedure, true) . "]");
     $inputsForTestProcedure = $this->transformToObjects($inputsForTestProcedure);
     KalturaLog::info("Tests data provided [" . print_r($inputsForTestProcedure, true) . "]");
     return $inputsForTestProcedure;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:48,代码来源:KalturaTestCaseBase.php


示例20: setCuePoints

 public function setCuePoints(DOMElement $item, array $cuePoints)
 {
     foreach ($cuePoints as $cuePoint) {
         /* @var $cuePoint cuePoint */
         $content = $this->cuePoint->cloneNode(true);
         $mediaGroup = $this->xpath->query('.', $item)->item(0);
         $mediaGroup->appendChild($content);
         kXml::setNodeValue($this->xpath, '@type', self::MILLISECONDS, $content);
         kXml::setNodeValue($this->xpath, '@startTime', $cuePoint->getStartTime(), $content);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:11,代码来源:ComcastMrssFeed.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP keke_cache_class类代码示例发布时间:2022-05-23
下一篇:
PHP kString类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap