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


PHP KalturaLog::DEBUG方法代码示例

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


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

示例1: handleItemUpdate

 /**
  * Handles xml bulk upload update
  * @param SimpleXMLElement $item
  * @throws KalturaException
  */
 protected function handleItemUpdate(SimpleXMLElement $item)
 {
     KalturaLog::debug("xml [" . $item->asXML() . "]");
     $entryId = null;
     $conversionProfileId = null;
     if (isset($item->entryId)) {
         $entryId = "{$item->entryId}";
         $existingEntry = $this->getEntry($entryId);
         if (!$existingEntry) {
             throw new KalturaBatchException("Entry id [{$entryId}] not found", KalturaBatchJobAppErrors::BULK_ITEM_NOT_FOUND);
         }
         $conversionProfileId = $existingEntry->conversionProfileId;
     } elseif (isset($item->referenceId)) {
         $existingEntry = $this->getEntryFromReference("{$item->referenceId}");
         if (!$existingEntry) {
             throw new KalturaBatchException("Reference id [{$item->referenceId}] not found", KalturaBatchJobAppErrors::BULK_ITEM_NOT_FOUND);
         }
         $entryId = $existingEntry->id;
         $conversionProfileId = $existingEntry->conversionProfileId;
     } else {
         throw new KalturaBatchException("Missing entry id element", KalturaBatchJobAppErrors::BULK_MISSING_MANDATORY_PARAMETER);
     }
     // Overwriting conversionProfileId if one is supplied in the XML
     if (isset($item->conversionProfileId) || isset($item->conversionProfile)) {
         $conversionProfileId = $this->getConversionProfileId($item);
     }
     KalturaLog::DEBUG("Conversion profile found within XML - setting to [ {$conversionProfileId} ]");
     //Throw exception in case of max proccessed items and handle all exceptions there
     $updatedEntryBulkUploadResult = $this->createUploadResult($item, KalturaBulkUploadAction::UPDATE);
     if ($this->exceededMaxRecordsEachRun) {
         // exit if we have proccessed max num of items
         return;
     }
     $entry = $this->createEntryFromItem($item, $existingEntry->type);
     //Creates the entry from the item element
     $this->handleTypedElement($entry, $item);
     //Sets the typed element values (Mix, Media, ...)
     KalturaLog::debug("current entry is: " . print_r($entry, true));
     $thumbAssets = array();
     $thumbAssetsResources = array();
     $flavorAssets = array();
     $flavorAssetsResources = array();
     $noParamsThumbAssets = array();
     //Holds the no flavor params thumb assests
     $noParamsThumbResources = array();
     //Holds the no flavor params resources assests
     $noParamsFlavorAssets = array();
     //Holds the no flavor params flavor assests
     $noParamsFlavorResources = array();
     //Holds the no flavor params flavor resources
     $flavorAssetsForUpdate = array();
     $flavorResources = array();
     $thumbAssetsForUpdate = array();
     $thumbResources = array();
     $resource = new KalturaAssetsParamsResourceContainers();
     // holds all teh needed resources for the conversion
     $resource->resources = array();
     if (isset($item->contentAssets->action) && isset($item->thumbnails->action)) {
         $contentAssetsAction = strtolower($item->contentAssets->action);
         $thumbnailsAction = strtolower($item->thumbnails->action);
     } elseif (isset($item->contentAssets->action)) {
         $contentAssetsAction = strtolower($item->contentAssets->action);
         $thumbnailsAction = strtolower($item->contentAssets->action);
     } elseif (isset($item->thumbnails->action)) {
         $contentAssetsAction = strtolower($item->thumbnails->action);
         $thumbnailsAction = strtolower($item->thumbnails->action);
     } else {
         //default action to perfom for assets and thumbnails is replace
         $contentAssetsAction = self::$actionsMap[KalturaBulkUploadAction::REPLACE];
         $thumbnailsAction = self::$actionsMap[KalturaBulkUploadAction::REPLACE];
     }
     if (isset($item->contentAssets->action) && isset($item->thumbnails->action) && $contentAssetsAction != $thumbnailsAction) {
         throw new KalturaBatchException("ContentAsset->action: {$contentAssetsAction} must be the same as thumbnails->action: {$thumbnailsAction}", KalturaBatchJobAppErrors::BULK_ACTION_NOT_SUPPORTED);
     }
     //For each content in the item element we add a new flavor asset
     if (isset($item->contentAssets)) {
         foreach ($item->contentAssets->content as $contentElement) {
             KalturaLog::debug("contentElement [" . print_r($contentElement->asXml(), true) . "]");
             if (empty($contentElement)) {
                 continue;
             }
             $flavorAsset = $this->getFlavorAsset($contentElement, $conversionProfileId);
             $flavorAssetResource = $this->getResource($contentElement, $conversionProfileId);
             if (!$flavorAssetResource) {
                 continue;
             }
             $assetParamsId = $flavorAsset->flavorParamsId;
             $assetId = kXml::getXmlAttributeAsString($contentElement, "assetId");
             if ($assetId) {
                 KalturaLog::debug("Asset id [ {$assetId}]");
                 $assetParamsId = $this->getAssetParamsIdFromAssetId($assetId, $entryId);
             }
             KalturaLog::debug("assetParamsId [{$assetParamsId}]");
             if (is_null($assetParamsId)) {
                 $noParamsFlavorAssets[] = $flavorAsset;
//.........这里部分代码省略.........
开发者ID:kubrickfr,项目名称:server,代码行数:101,代码来源:BulkUploadEngineXml.php

示例2: assetParamDeleted

 /**
  * @param assetParams $assetParam
  */
 protected function assetParamDeleted(assetParams $assetParam)
 {
     //In Case Flavor Deleted Belongs To Partner 0 Exit Without Deleteing
     if ($assetParam->getPartnerId() == 0) {
         KalturaLog::DEBUG("Deleting Flavor Param Of Partner 0 Is Restricted");
         return;
     }
     $c = new Criteria();
     $c->setLimit(100);
     $c->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $assetParam->getId());
     for (;;) {
         $flavorParamsConversionProfiles = flavorParamsConversionProfilePeer::doSelect($c);
         foreach ($flavorParamsConversionProfiles as $flavorParamsConversionProfile) {
             /* @var $flavorParamsConversionProfile flavorParamsConversionProfile */
             $flavorParamsConversionProfile->delete();
         }
         if (count($flavorParamsConversionProfiles) < 100) {
             break;
         }
         flavorParamsConversionProfilePeer::clearInstancePool();
     }
     KalturaLog::DEBUG("Flavor Params Conversion Profile Relations were deleted for flavor param id [" . $assetParam->getId() . "]");
 }
开发者ID:kubrickfr,项目名称:server,代码行数:26,代码来源:kObjectDeleteHandler.php

示例3: execute


//.........这里部分代码省略.........
                     $level3_url = $request . $flv_extension;
                     if ($entry->getSecurityPolicy()) {
                         $level3_url = "/s{$level3_url}";
                         // set expire time in GMT hence the date("Z") offset
                         $expire = "&nva=" . strftime("%Y%m%d%H%M%S", time() - date("Z") + 30);
                         $level3_url .= $expire;
                         $secret = kConf::get("level3_authentication_key");
                         $hash = "0" . substr(self::hmac('sha1', $secret, $level3_url), 0, 20);
                         $level3_url .= "&h={$hash}";
                     }
                     $level3_url .= $seek_from_bytes == -1 ? "" : "&start={$seek_from_bytes}";
                     header("Location: {$level3_url}");
                     KExternalErrors::dieGracefully();
                 } else {
                     if ($cdn_name == "akamai") {
                         $akamai_url = $request . $flv_extension;
                         // if for some reason we didnt set our accurate $seek_from_timestamp reset it to the requested seek_from
                         if ($seek_from_timestamp == -1) {
                             $seek_from_timestamp = $seek_from;
                         }
                         $akamai_url .= $seek_from_bytes == -1 ? "" : "&aktimeoffset=" . floor($seek_from_timestamp / 1000);
                         header("Location: {$akamai_url}");
                         KExternalErrors::dieGracefully();
                     }
                 }
             }
             // a seek request without a supporting cdn - we need to send the answer from our server
             if ($seek_from_bytes !== -1 && $via_header === null) {
                 $this->dump_from_byte = $seek_from_bytes;
             }
         }
     }
     // always add the file suffix to the request (needed for scrubbing by some cdns,
     // and also breaks without extension on some corporate antivirus).
     // we add the the novar paramter since a leaving a trailing "?" will be trimmed
     // and then the /seek_from request will result in another url which level3
     // will try to refetch from the origin
     // note that for streamer we dont add the file extension
     if ($streamer != "rtmp" && strpos($request, $flv_extension) === false) {
         // a seek request without a supporting cdn - we need to send the answer from our server
         if ($seek_from_bytes !== -1 && $via_header === null) {
             $request .= "/seek_from_bytes/{$seek_from_bytes}";
         }
         requestUtils::sendCdnHeaders("flv", 0);
         header("Location: {$request}" . $flv_extension);
         KExternalErrors::dieGracefully();
     }
     // mp4
     if (!$isFlv) {
         $limit_file_size = 0;
         if ($clip_to != 2147483647) {
             $mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($flavorAsset->getId());
             if ($mediaInfo && ($mediaInfo->getVideoDuration() || $mediaInfo->getAudioDuration() || $mediaInfo->getContainerDuration())) {
                 $duration = $mediaInfo->getVideoDuration() ? $mediaInfo->getVideoDuration() : ($mediaInfo->getAudioDuration() ? $mediaInfo->getAudioDuration() : $mediaInfo->getContainerDuration());
                 $limit_file_size = floor(@kFile::fileSize($path) * ($clip_to / $duration) * 1.2);
             }
         }
         KalturaLog::DEBUG("serving file [{$path}] entry id [{$entry_id}] limit file size [{$limit_file_size}] clip_to [{$clip_to}]");
         kFileUtils::dumpFile($path, null, null, $limit_file_size);
     }
     $this->logMessage("flvclipperAction: serving file [{$path}] entry_id [{$entry_id}] clip_from [{$clip_from}] clip_to [{$clip_to}]", "warning");
     if ($audio_only === '0') {
         // audio_only was explicitly set to 0 - don't attempt to make further automatic investigations
     } elseif ($flv_wrapper->getFirstVideoTimestamp() < 0) {
         $audio_only = true;
     }
     //$start = microtime(true);
     list($bytes, $duration, $from_byte, $to_byte, $from_ts, $cuepoint_pos) = myFlvStaticHandler::clip($path, $clip_from, $clip_to, $audio_only);
     $metadata_size = $flv_wrapper->getMetadataSize($audio_only);
     $this->from_byte = $from_byte;
     $this->to_byte = $to_byte;
     //$end1 = microtime(true);
     //$this->logMessage( "flvclipperAction: serving file [$path] entry_id [$entry_id] bytes [$bytes] duration [$duration] [$from_byte]->[$to_byte]" , "warning" );
     //$this->logMessage( "flvclipperAction: serving file [$path] t1 [" . ( $end1-$start) . "]");
     $data_offset = $metadata_size + myFlvHandler::getHeaderSize();
     // if we're returning a partial file adjust the total size:
     // substract the metadata and bytes which are not delivered
     if ($this->dump_from_byte >= $data_offset && !$audio_only) {
         $bytes -= $metadata_size + max(0, $this->dump_from_byte - $data_offset);
     }
     $this->total_length = $data_offset + $bytes;
     //echo " $bytes , $duration ,$from_byte , $to_byte, $cuepoint_pos\n"; die;
     $this->cuepoint_time = 0;
     $this->cuepoint_pos = 0;
     if ($streamer == "chunked" && $clip_to != 2147483647) {
         $this->cuepoint_time = $clip_to - 1;
         $this->cuepoint_pos = $cuepoint_pos;
         $this->total_length += myFlvHandler::CUEPOINT_TAG_SIZE;
     }
     //$this->logMessage( "flvclipperAction: serving file [$path] entry_id [$entry_id] bytes with header & md [" . $this->total_length . "] bytes [$bytes] duration [$duration] [$from_byte]->[$to_byte]" , "warning" );
     $this->flv_wrapper = $flv_wrapper;
     $this->audio_only = $audio_only;
     try {
         Propel::close();
     } catch (Exception $e) {
         $this->logMessage("flvclipperAction: error closing db {$e}");
     }
     KExternalErrors::terminateDispatch();
     return sfView::SUCCESS;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:101,代码来源:flvclipperAction.class.php

示例4: deleteEntry

 public static function deleteEntry(entry $entry, $partner_id = null, $onlyIfAllJobsDone = false)
 {
     if ($entry->getStatus() == entryStatus::DELETED || $entry->getStatus() == entryStatus::BLOCKED) {
         return;
     }
     // don't do this twice !
     if ($onlyIfAllJobsDone) {
         KalturaLog::DEBUG("onlyIfAllJobsDone = " . (int) $onlyIfAllJobsDone);
         $dbEntryBatchJobLocks = BatchJobLockPeer::retrieveByEntryId($entry->getId());
         foreach ($dbEntryBatchJobLocks as $jobLock) {
             /* @var $jobLock BatchJobLock */
             $job = $jobLock->getBatchJob();
             /* @var $job BatchJob */
             KalturaLog::DEBUG("Entry [" . $entry->getId() . "] still has an unhandled batchjob [" . $job->getId() . "] with status [" . $job->getStatus() . "] - aborting deletion process.");
             //mark entry for later deletion
             $entry->setMarkedForDeletion(true);
             $entry->save();
             return;
         }
     }
     KalturaLog::log("myEntryUtils::delete Entry [" . $entry->getId() . "] Partner [" . $entry->getPartnerId() . "]");
     kJobsManager::abortEntryJobs($entry->getId());
     $media_type = $entry->getMediaType();
     $need_to_fix_roughcut = false;
     $thumb_template_file = "&deleted_image.jpg";
     KalturaLog::log("media type [{$media_type}]");
     switch ($media_type) {
         case entry::ENTRY_MEDIA_TYPE_AUDIO:
             $template_file = "&deleted_audio.flv";
             $need_to_fix_roughcut = true;
             break;
         case entry::ENTRY_MEDIA_TYPE_IMAGE:
             $template_file = "&deleted_image.jpg";
             $need_to_fix_roughcut = false;
             // no need to add a batch job for images
             break;
         case entry::ENTRY_MEDIA_TYPE_VIDEO:
             $template_file = "&deleted_video.flv";
             $need_to_fix_roughcut = true;
             break;
         case entry::ENTRY_MEDIA_TYPE_SHOW:
         default:
             $template_file = "&deleted_rc.xml";
             $need_to_fix_roughcut = false;
             break;
     }
     if ($entry->getType() == entryType::LIVE_STREAM) {
         kJobsManager::addProvisionDeleteJob(null, $entry);
     }
     // in this case we'll need some batch job to fix all related roughcuts for this entry
     // use the batch_job mechanism to indicate there is a deleted entry to handle
     if ($need_to_fix_roughcut) {
         //			Should use a different job type
         //			BatchJob::createDeleteEntryJob ( $entry );
     }
     $entry->putInCustomData("deleted_original_data", $entry->getData());
     $entry->putInCustomData("deleted_original_thumb", $entry->getThumbnail());
     $content_path = myContentStorage::getFSContentRootPath();
     //		Remarked by Tan-Tan 27/09/2010
     //		Handled by kObjectDeleteHandler
     //		$currentDataKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA); // replaced__getDataPath
     //		$currentDataEditKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA_EDIT); // replaced__getDataPathEdit
     //		$currentThumbKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB); // replaced__getThumbnailPath
     $entry->setData($entry->getData());
     // once to increment the verions
     $entry->setData($template_file);
     // the other to set the template
     $entry->setThumbnail($entry->getThumbnail());
     // once to increment the verions
     $entry->setThumbnail($thumb_template_file);
     // the other to set the template
     //		Remarked by Tan-Tan 27/09/2010
     //		Handled by kObjectDeleteHandler
     //		// move file so there will be no access to it
     //		$deleted_content = kFileSyncUtils::deleteSyncFileForKey($currentDataKey);
     //		$deleted_content .= "|" . kFileSyncUtils::deleteSyncFileForKey($currentDataEditKey,false); // for some entries there may not be an edit version
     //		$deleted_content .= "|" . kFileSyncUtils::deleteSyncFileForKey($currentThumbKey,false); // for some entries (empty mix / audio) there may not be a thumb FileSync
     //		Remarked by Tan-Tan 27/09/2010
     //		$deleted_content is always null anyway
     //		$entry->putInCustomData( "deleted_file_path" , $deleted_content ? $deleted_content : serialize($currentDataKey) ) ;
     $entry->setStatus(entryStatus::DELETED);
     //$entry->setCategories("");
     // make sure the moderation_status is set to moderation::MODERATION_STATUS_DELETE
     $entry->setModerationStatus(moderation::MODERATION_STATUS_DELETE);
     $entry->setModifiedAt(time());
     $entry->save();
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_DELETE, $entry, null, null, null, null, $entry->getId());
 }
开发者ID:kubrickfr,项目名称:server,代码行数:88,代码来源:myEntryUtils.class.php


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