本文整理汇总了PHP中KalturaLog::log方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog::log方法的具体用法?PHP KalturaLog::log怎么用?PHP KalturaLog::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaLog
的用法示例。
在下文中一共展示了KalturaLog::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildCfgFile
public function buildCfgFile($inputFile, $outputFile, $format = null, $width = null, $height = null, $keyFramesInSec = null, $bitrate = null, $videoCodec = null, $audioCodec = null)
{
if (is_null($format)) {
$format = "WMV";
}
if ($format == "WMV") {
if (is_null($width)) {
$width = 1280;
}
if (is_null($height)) {
$height = 960;
}
if (is_null($keyFramesInSec)) {
$keyFramesInSec = 4;
}
if (is_null($bitrate)) {
$bitrate = 2000;
}
if (is_null($videoCodec)) {
$videoCodec = "Windows Media Video 9";
}
if (is_null($audioCodec)) {
$audioCodec = "Windows Media Audio 10 Professional";
}
} else {
if ($format == "MP4") {
}
}
$cfg = str_replace(array("inputfile=", "outputfile=", "media=", "__webexTargetFormat__", "width=", "height=", "videocodec=", "audiocodec=", "videokeyframes=", "maxstream="), array("inputfile=" . $inputFile, "outputfile=" . $outputFile, "media=" . $format, $format, "width=" . $width, "height=" . $height, "videocodec=" . $videoCodec, "audiocodec=" . $audioCodec, "videokeyframes=" . $keyFramesInSec, "maxstream=" . $bitrate), self::WebexCfgTemplate);
KalturaLog::log($cfg);
return $cfg;
}
示例2: __construct
/**
* @param string $str
*/
private function __construct($str)
{
if (empty($str)) {
$this->data = array();
}
try {
$this->data = @unserialize($str);
if ($this->data == null) {
$this->data = array();
} else {
foreach ($this->data as $name => $value) {
if (strpos($name, ':') > 0) {
list($namespace, $subName) = explode(':', $name, 2);
unset($this->data[$name]);
if (!isset($this->data[$namespace])) {
$this->data[$namespace] = array();
}
$this->data[$namespace][$subName] = $value;
}
}
}
} catch (Exception $ex) {
// cannot initialize from $str
KalturaLog::log(__METHOD__ . ", cannot init from string [{$str}]");
$this->data = array();
}
}
示例3: Generate
public function Generate(KDLMediaDataSet $mediaSet, KDLProfile $profile, array &$targetList)
{
if ($mediaSet != null && $mediaSet->IsDataSet()) {
$rv = $this->Initialize($mediaSet);
if ($rv == false) {
/*
* fix #9599 - handles rm files that fails to extract media info, but still playable by real player -
* simulate video and audio elements, although no source mediainfo is provided
*/
if ($this->_srcDataSet->_container && $this->_srcDataSet->_container->IsFormatOf(array("realmedia"))) {
$rmSrc = $this->_srcDataSet;
$rmSrc->_errors = array();
$rmSrc->_video = new KDLVideoData();
$rmSrc->_video->_id = $rmSrc->_video->_format = "realvideo";
$rmSrc->_audio = new KDLAudioData();
$rmSrc->_audio->_id = $rmSrc->_audio->_format = "realaudio";
$rmSrc->_warnings[KDLConstants::ContainerIndex][] = KDLWarnings::ToString(KDLWarnings::RealMediaMissingContent);
KalturaLog::log("An invalid source RealMedia file thatfails to provide valid mediaInfodata. Set up a flavor with 'default' params.");
} else {
return false;
}
}
}
if ($profile == null) {
return true;
}
$this->GenerateTargetFlavors($profile, $targetList);
if (count($this->_srcDataSet->_errors) > 0) {
return false;
}
return true;
}
示例4: addFileSyncImportJob
/**
* @param string $entryId
* @param FileSync $object
* @param int $fileSyncId
* @param string $sourceFileUrl
* @return BatchJob
*/
public static function addFileSyncImportJob($entryId, FileSync $fileSync, $sourceFileUrl, BatchJob $parentJob = null, $fileSize = null)
{
$partnerId = $fileSync->getPartnerId();
$fileSyncId = $fileSync->getId();
$dc = $fileSync->getDc();
KalturaLog::log(__METHOD__ . " entryId[{$entryId}], partnerId[{$partnerId}], fileSyncId[{$fileSyncId}], sourceFileUrl[{$sourceFileUrl}]");
$fileSyncImportData = new kFileSyncImportJobData();
$fileSyncImportData->setSourceUrl($sourceFileUrl);
$fileSyncImportData->setFilesyncId($fileSyncId);
$fileSyncImportData->setFileSize($fileSize);
// tmpFilePath and destFilePath will be set later during get exlusive call on the target data center
$batchJob = null;
if ($parentJob) {
$batchJob = $parentJob->createChild(BatchJobType::FILESYNC_IMPORT, null, true, $dc);
} else {
$batchJob = new BatchJob();
$batchJob->setDc($dc);
$batchJob->setEntryId($entryId);
$batchJob->setPartnerId($partnerId);
}
$batchJob->setObjectId($fileSyncId);
$batchJob->setObjectType(BatchJobObjectType::FILE_SYNC);
//In case file sync is of type data and holds flavor asset than we need to check if its the source asset that is being synced and raise it sync priority
if ($fileSync->getObjectType() == FileSyncObjectType::FLAVOR_ASSET && $fileSync->getObjectSubType() == entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA && $fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_FILE) {
$assetdb = assetPeer::retrieveById($fileSync->getObjectId());
if ($assetdb) {
$isSourceAsset = $assetdb->getIsOriginal();
if ($isSourceAsset) {
$fileSyncImportData->setIsSourceAsset(true);
}
}
}
KalturaLog::log("Creating Filesync Import job, with file sync id: {$fileSyncId} size: {$fileSize}");
return kJobsManager::addJob($batchJob, $fileSyncImportData, BatchJobType::FILESYNC_IMPORT);
}
示例5: save
public function save(PropelPDO $con = null)
{
KalturaLog::log("BatchJob [{$this->getJobType()}][{$this->getJobSubType()}]: save()");
$is_new = $this->isNew();
if ($this->isNew()) {
$this->setDc(kDataCenterMgr::getCurrentDcId());
// if the status not set upon creation
if (is_null($this->status) || !$this->isColumnModified(BatchJobPeer::STATUS)) {
//echo "sets the status to " . self::BATCHJOB_STATUS_PENDING . "\n";
$this->setStatus(self::BATCHJOB_STATUS_PENDING);
}
}
$res = parent::save($con);
if ($is_new && !$this->root_job_id && $this->id) {
// set the root to point to itself
$this->setRootJobId($this->id);
$res = parent::save($con);
}
/*
* remove - no need to use file indicators any more
// when new object or status is pending - add the indicator for the batch job to start running
if ( $is_new || ( $this->getStatus() == self::BATCHJOB_STATUS_PENDING ) )
{
self::addIndicator( $this->getId() , $this->getJobType() );
KalturaLog::log ( "BatchJob: Added indicator for BatchJob [" . $this->getId() . "] of type [{$this->getJobType() }]" );
//debugUtils::st();
}
else
{
KalturaLog::log ( "BatchJob: Didn't add an indicator for BatchJob [" . $this->getId() . "]" );
}
*/
return $res;
}
示例6: getCmdLine
protected function getCmdLine()
{
$cmdLine = parent::getCmdLine();
$cmdLine = KConversionEngineFfmpeg::experimentalFixing($cmdLine, $this->data->flavorParamsOutput, $this->cmd, $this->inFilePath, $this->outFilePath);
$cmdLine = KConversionEngineFfmpeg::expandForcedKeyframesParams($cmdLine);
$wmStr = strstr($this->operator->params, "watermark:");
if ($wmStr == false) {
return $cmdLine;
}
$wmStr = trim(substr($this->operator->params, strlen("watermark:")));
/*
* If no watermarkData, carry on
*/
if ($wmStr == null) {
return $cmdLine;
}
KalturaLog::log("Watermark string({$wmStr})");
$wmData = json_decode($wmStr);
if (!isset($wmData)) {
KalturaLog::err("Bad watermark JSON string({$wmStr}), carry on without watermark");
}
KalturaLog::log("Watermark data:\n" . print_r($wmData, 1));
// impersonite
KBatchBase::impersonate($this->data->flavorParamsOutput->partnerId);
// !!!!!!!!!!!$this->job->partnerId);
$wmCmdLine = KConversionEngineFfmpeg::buildWatermarkedCommandLine($wmData, $this->data->destFileSyncLocalPath, $cmdLine, KBatchBase::$taskConfig->params->ffmpegCmd, KBatchBase::$taskConfig->params->mediaInfoCmd);
// un-impersonite
KBatchBase::unimpersonate();
if (isset($wmCmdLine)) {
$cmdLine = $wmCmdLine;
}
return $cmdLine;
}
示例7: uploadFileByToken
public static function uploadFileByToken($file_data, $token, $filename, $extra_id = null, $create_thumb = false)
{
KalturaLog::log("Trace while uploading1 [{$filename}] [{$token}] [{$extra_id}] " . print_r($file_data, true));
$origFilename = @$file_data['name'];
if (!$origFilename) {
KalturaLog::log("Error while uploading, file does not have a name. [{$filename}] [{$token}] [{$extra_id}] " . print_r($file_data, true) . "\nerror: [" . @$file_data["error"] . "]");
return;
}
$parts = pathinfo($origFilename);
$extension = @strtolower($parts['extension']);
/*
$filename = $token .'_'. $filename;
// add the file extension after the "." character
$fullPath = myContentStorage::getFSUploadsPath().$filename . ( $extra_id ? "_" . $extra_id : "" ) .".".$extension;
*/
list($fullPath, $fullUrl) = self::getUploadPathAndUrl($token, $filename, $extra_id, $extension);
KalturaLog::log("Trace while uploading2 [{$filename}] [{$token}] [{$extra_id}] " . print_r($file_data, true) . "\n->[{$fullPath}]");
// start tracking what will hopefully become an entry
$te = new TrackEntry();
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_UPLOADED_FILE);
$te->setParam1Str($token);
$te->setParam2Str($filename);
$te->setParam3Str($fullPath);
$te->setDescription(__METHOD__ . ":" . __LINE__);
TrackEntry::addTrackEntry($te);
myContentStorage::fullMkdir($fullPath);
if (!move_uploaded_file($file_data['tmp_name'], $fullPath)) {
KalturaLog::log("Error while uploading [{$token}] [{$filename}] [{$extra_id}] [{$create_thumb}] " . print_r($file_data, true) . "\n->[{$fullPath}]");
$err = array("token" => $token, "filename" => $filename, "origFilename" => $origFilename, "error" => @$file_data["error"]);
KalturaLog::log("Error while uploading [{$token}] [{$filename}] [{$extra_id}] [{$create_thumb}] " . print_r($file_data, true) . "\n->[{$fullPath}]" . "\n" . print_r($err, true));
return $err;
}
chmod($fullPath, 0777);
$upload_server_header = isset($_SERVER["HTTP_X_KALTURA_SERVER"]) ? $_SERVER["HTTP_X_KALTURA_SERVER"] : null;
$thumb_created = false;
// if the file originated from a kaltura upload server we dont need a thumbnail (kuploader)
if ($create_thumb && !$upload_server_header) {
$thumbFullPath = self::getThumbnailPath($fullPath, ".jpg");
kFile::fullMkdir($thumbFullPath);
KalturaLog::log("Thumbnail full path [{$thumbFullPath}]");
if (myContentStorage::fileExtAccepted($extension)) {
KalturaLog::log("Generating image thumbnail");
myFileConverter::createImageThumbnail($fullPath, $thumbFullPath, "image2");
$thumb_url = self::getThumbnailPath($fullUrl, ".jpg");
$thumb_created = file_exists($thumbFullPath);
} elseif (myContentStorage::fileExtNeedConversion($extension)) {
KalturaLog::log("Generating media thumbnail");
myFileConverter::captureFrame($fullPath, $thumbFullPath, 1, "image2", -1, -1, 3);
if (!file_exists($thumbFullPath)) {
myFileConverter::captureFrame($fullPath, $thumbFullPath, 1, "image2", -1, -1, 0);
}
}
}
if (!$thumb_created) {
KalturaLog::log("Thumbnail not generated");
// in this case no thumbnail was created - don't extract false data
$thumb_url = "";
}
return array("token" => $token, "filename" => $filename, "origFilename" => $origFilename, "thumb_url" => $thumb_url, "thumb_created" => $thumb_created);
}
示例8: getIdByStrId
public static function getIdByStrId($strId)
{
// try to get strId to id mapping form cache
$cacheKey = 'UserRolePeer_role_str_id_' . $strId;
if (kConf::get('enable_cache') && function_exists('apc_fetch') && function_exists('apc_store')) {
$id = apc_fetch($cacheKey);
// try to fetch from cache
if ($id) {
KalturaLog::debug("UserRole str_id [{$strId}] mapped to id [{$id}] - fetched from cache");
return $id;
}
}
// not found in cache - get from database
$c = new Criteria();
$c->addSelectColumn(UserRolePeer::ID);
$c->addAnd(UserRolePeer::STR_ID, $strId, Criteria::EQUAL);
$c->setLimit(1);
$stmt = UserRolePeer::doSelectStmt($c);
$id = $stmt->fetch(PDO::FETCH_COLUMN);
if ($id) {
// store the found id in cache for later use
if (kConf::get('enable_cache') && function_exists('apc_fetch') && function_exists('apc_store')) {
$success = apc_store($cacheKey, $id, kConf::get('apc_cache_ttl'));
if ($success) {
KalturaLog::debug("UserRole str_id [{$strId}] mapped to id [{$id}] - stored in cache");
}
}
}
if (!$id) {
KalturaLog::log("UserRole with str_id [{$strId}] not found in DB!");
}
return $id;
}
示例9: generateFilePathArr
/**
* will return a pair of file_root and file_path
* This is the only function that should be extended for building a different path
*
* @param ISyncableFile $object
* @param int $subType
* @param $version
*/
public function generateFilePathArr(ISyncableFile $object, $subType, $version = null, $storageProfileId = null)
{
// currently xsl paths are only used for assets
if (!$object instanceof asset) {
return parent::generateFilePathArr($object, $subType, $version, $storageProfileId);
}
$storageProfile = kPathManager::getStorageProfile($storageProfileId);
$pathXsl = $storageProfile->getPathFormat();
$entry = $object->getEntry();
$xslVariables = $this->getXslVariables($storageProfile, $object, $subType, $version, $entry);
$xslStr = $this->getXsl($pathXsl, $xslVariables);
try {
$path = $this->getPathValue($entry, $xslStr);
} catch (Exception $e) {
KalturaLog::err('Error executing XSL - ' . $e->getMessage());
$path = null;
}
if (empty($path)) {
KalturaLog::log('Empty path recieved - using parent\'s path instead');
return parent::generateFilePathArr($object, $subType, $version, $storageProfileId);
}
$path = trim($path);
KalturaLog::debug('Path value [' . $path . ']');
$root = '/';
return array($root, $path);
}
示例10: copyAssets
public function copyAssets(entry $toEntry, ThumbCuePoint $toCuePoint, $adjustedStartTime = null)
{
$timedThumbAsset = assetPeer::retrieveById($this->getAssetId());
if (!$timedThumbAsset) {
KalturaLog::debug("Can't retrieve timedThumbAsset with id: {$this->getAssetId()}");
return;
}
// Offset the startTime according to the duration gap between the live and VOD entries
if (!is_null($adjustedStartTime)) {
$toCuePoint->setStartTime($adjustedStartTime);
}
$toCuePoint->save();
// Must save in order to produce an id
$timedThumbAsset->setCuePointID($toCuePoint->getId());
// Set the destination cue point's id
$timedThumbAsset->setCustomDataObj();
// Write the cached custom data object into the thumb asset
// Make a copy of the current thumb asset
// copyToEntry will create a filesync softlink to the original filesync
$toTimedThumbAsset = $timedThumbAsset->copyToEntry($toEntry->getId(), $toEntry->getPartnerId());
$toCuePoint->setAssetId($toTimedThumbAsset->getId());
$toCuePoint->save();
// Restore the thumb asset's prev. cue point id (for good measures)
$timedThumbAsset->setCuePointID($this->getId());
$timedThumbAsset->setCustomDataObj();
// Save the destination entry's thumb asset
$toTimedThumbAsset->setCuePointID($toCuePoint->getId());
$toTimedThumbAsset->save();
KalturaLog::log("Saved cue point [{$toCuePoint->getId()}] and timed thumb asset [{$toTimedThumbAsset->getId()}]");
}
示例11: __construct
public function __construct($id, $name = null, $sourceBlacklist = null, $targetBlacklist = null)
{
KalturaLog::log("KDLOperatorBase::__construct: id({$id}), name({$name}), sourceBlacklist(" . print_r($sourceBlacklist, true) . "), targetBlacklist(" . print_r($targetBlacklist, true) . ")");
$this->_id = $id;
$this->_name = $name;
$this->_sourceBlacklist = $sourceBlacklist;
$this->_targetBlacklist = $targetBlacklist;
}
示例12: validateFileSyncSubType
protected static function validateFileSyncSubType($sub_type)
{
if ($sub_type == self::FILE_SYNC_ASSET_SUB_TYPE_LIVE_PRIMARY || $sub_type == self::FILE_SYNC_ASSET_SUB_TYPE_LIVE_SECONDARY) {
return true;
}
KalturaLog::log("Sub type provided [{$sub_type}] is not one of known live-asset sub types validating from parent");
return parent::validateFileSyncSubType($sub_type);
}
示例13: validateFileSyncSubType
protected static function validateFileSyncSubType($sub_type)
{
if ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_LIVE_PRIMARY || $sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_LIVE_SECONDARY || $sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_THUMB || $sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_OFFLINE_THUMB) {
return true;
}
KalturaLog::log("Sub type provided [{$sub_type}] is not one of knowen LiveEntry sub types validating from parent");
return parent::validateFileSyncSubType($sub_type);
}
示例14: filterTagFlavors
public static function filterTagFlavors(array $flavors)
{
KalturaLog::log("Filter Tag Flavors, " . count($flavors) . " flavors supplied");
// check if there is a complete flavor
$hasComplied = false;
$hasForced = false;
$originalFlavorParamsIds = array();
foreach ($flavors as $flavorParamsId => $flavor) {
$originalFlavorParamsIds[] = $flavor->getFlavorParamsId();
if (!$flavor->_isNonComply) {
$hasComplied = true;
}
if ($flavor->_force) {
$hasForced = true;
}
}
$originalFlavorParams = array();
$dbOriginalFlavorParams = flavorParamsPeer::retrieveByPKs($originalFlavorParamsIds);
foreach ($dbOriginalFlavorParams as $dbFlavorParams) {
$originalFlavorParams[$dbFlavorParams->getId()] = $dbFlavorParams;
}
// return only complete flavors
if ($hasComplied) {
KalturaLog::log("Has complied flavors");
}
if ($hasForced) {
KalturaLog::log("Has forced flavors");
}
if ($hasComplied || $hasForced) {
return $flavors;
}
// find the lowest flavor
$lowestFlavorParamsId = null;
foreach ($flavors as $flavorParamsId => $flavor) {
if (!$flavor->IsValid()) {
continue;
}
// is lower than the selected
if (!isset($originalFlavorParams[$flavor->getFlavorParamsId()])) {
continue;
}
$currentOriginalFlavor = $originalFlavorParams[$flavor->getFlavorParamsId()];
// is first flavor to check
if (is_null($lowestFlavorParamsId)) {
$lowestFlavorParamsId = $flavorParamsId;
continue;
}
$lowestOriginalFlavor = $originalFlavorParams[$flavors[$lowestFlavorParamsId]->getFlavorParamsId()];
if (self::isFlavorLower($currentOriginalFlavor, $lowestOriginalFlavor)) {
$lowestFlavorParamsId = $flavorParamsId;
}
}
if ($lowestFlavorParamsId) {
KalturaLog::log("Lowest flavor selected [{$lowestFlavorParamsId}]");
$flavors[$lowestFlavorParamsId]->_create_anyway = true;
}
return $flavors;
}
示例15: buildServeFlavors
public function buildServeFlavors()
{
$flavor = $this->getSecureHdUrl();
if (!$flavor) {
KalturaLog::log('No flavor found');
return null;
}
return array($flavor);
}