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


PHP KalturaLog::ERR方法代码示例

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


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

示例1: applyCondition

 /**
  * Adds conditions, matches and where clauses to the query
  * @param IKalturaIndexQuery $query
  */
 public function applyCondition(IKalturaDbQuery $query)
 {
     switch ($this->getComparison()) {
         case KalturaSearchConditionComparison::EQUAL:
             $comparison = ' = ';
             break;
         case KalturaSearchConditionComparison::GREATER_THAN:
             $comparison = ' > ';
             break;
         case KalturaSearchConditionComparison::GREATER_THAN_OR_EQUAL:
             $comparison = ' >= ';
             break;
         case KalturaSearchConditionComparison::LESS_THAN:
             $comparison = " < ";
             break;
         case KalturaSearchConditionComparison::LESS_THAN_OR_EQUAL:
             $comparison = " <= ";
             break;
         case KalturaSearchConditionComparison::NOT_EQUAL:
             $comparison = " <> ";
             break;
         default:
             KalturaLog::ERR("Missing comparison type");
             return;
     }
     $field = $this->getField();
     $value = $this->getValue();
     $fieldValue = $this->getFieldValue($field);
     if (is_null($fieldValue)) {
         KalturaLog::err('Unknown field [' . $field . ']');
         return;
     }
     $newCondition = $fieldValue . $comparison . KalturaCriteria::escapeString($value);
     $query->addCondition($newCondition);
 }
开发者ID:kubrickfr,项目名称:server,代码行数:39,代码来源:AdvancedSearchFilterComparableCondition.class.php

示例2: getExclusiveFileSyncImportJobsAction

 /**
  * batch getExclusiveFileSyncImportJob action allows to get a BatchJob of type FILESYNC_IMPORT
  *
  * @action getExclusiveFileSyncImportJobs
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism
  * @param int $maxExecutionTime The maximum time in seconds the job reguarly take. Is used for the locking mechanism when determining an unexpected termination of a batch-process.
  * @param int $numberOfJobs The maximum number of jobs to return.
  * @param KalturaBatchJobFilter $filter Set of rules to fetch only rartial list of jobs
  * @param int $maxOffset The maximum offset we accept for the distance from the best result.
  * @return KalturaBatchJobArray
  *
  * TODO remove the destFilePath from the job data and get it later using the api, then delete this method
  */
 function getExclusiveFileSyncImportJobsAction(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null, $maxOffset = null)
 {
     $coreJobs = $this->getExclusiveJobs($lockKey, $maxExecutionTime, $numberOfJobs, $filter, BatchJobType::FILESYNC_IMPORT, $maxOffset);
     $jobs = KalturaBatchJobArray::fromBatchJobArray($coreJobs);
     if ($jobs) {
         foreach ($jobs as $index => $job) {
             $data = $job->data;
             // try to get destination path from file sync
             $fileSyncId = $data->filesyncId;
             $fileSync = FileSyncPeer::retrieveByPK($fileSyncId);
             if (!$fileSync) {
                 KalturaLog::err("Failed to load file sync [{$fileSyncId}] aborting job [{$job->id}]");
                 $dbJob = BatchJobPeer::retrieveByPK($job->id);
                 $dbJob->setMessage("Failed to load file sync [{$fileSyncId}]");
                 kJobsManager::abortDbBatchJob($dbJob);
                 unset($jobs[$index]);
                 continue;
             }
             $fileSyncRoot = $fileSync->getFileRoot();
             $fileSyncPath = $fileSync->getFilePath();
             if ($fileSyncRoot && $fileSyncPath) {
                 // destination path set on filesync
                 $dest_path = $fileSyncRoot . $fileSyncPath;
             } else {
                 // not set on filesync - get path from path manager
                 $fileSyncKey = kFileSyncUtils::getKeyForFileSync($fileSync);
                 list($file_root, $real_path) = kPathManager::getFilePathArr($fileSyncKey);
                 $dest_path = $file_root . $real_path;
                 // update filesync on database
                 $fileSync->setFileRoot($file_root);
                 $fileSync->setFilePath($real_path);
                 $fileSync->save();
             }
             // update job data with destination path if needed
             if (!$data->destFilePath) {
                 $data->destFilePath = $dest_path;
                 $job->data = $data;
                 KalturaLog::log('Updating destination path for job id [$job->id]');
                 $this->updateJob($job);
             }
             if (!is_dir(dirname($dest_path)) && !@mkdir(dirname($dest_path), 0755, true)) {
                 KalturaLog::ERR("Cannot create directory [{$dest_path}] - " . error_get_last());
             }
         }
     }
     return $jobs;
 }
开发者ID:AdiTal,项目名称:server,代码行数:60,代码来源:FileSyncImportBatchService.php

示例3: applyCondition

 /**
  * Adds conditions, matches and where clauses to the query
  * @param IKalturaIndexQuery $query
  */
 public function applyCondition(IKalturaDbQuery $query)
 {
     switch ($this->getComparison()) {
         case KalturaSearchConditionComparison::EQUAL:
             $comparison = ' = ';
             break;
         case KalturaSearchConditionComparison::GREATER_THAN:
             $comparison = ' > ';
             break;
         case KalturaSearchConditionComparison::GREATER_THAN_OR_EQUAL:
             $comparison = ' >= ';
             break;
         case KalturaSearchConditionComparison::LESS_THAN:
             $comparison = " < ";
             break;
         case KalturaSearchConditionComparison::LESS_THAN_OR_EQUAL:
             $comparison = " <= ";
             break;
         case KalturaSearchConditionComparison::NOT_EQUAL:
             $comparison = " <> ";
             break;
         default:
             KalturaLog::ERR("Missing comparison type");
             return;
     }
     $field = $this->getField();
     $value = $this->getValue();
     $fieldValue = null;
     switch ($field) {
         case Criteria::CURRENT_DATE:
             $d = getdate();
             $fieldValue = mktime(0, 0, 0, $d['mon'], $d['mday'], $d['year']);
             break;
         case Criteria::CURRENT_TIME:
         case Criteria::CURRENT_TIMESTAMP:
             $fieldValue = time();
             break;
         default:
             KalturaLog::err('Unknown field [' . $field . ']');
             return;
     }
     $newCondition = $fieldValue . $comparison . SphinxUtils::escapeString($value);
     $query->addCondition($newCondition);
 }
开发者ID:visomar,项目名称:server,代码行数:48,代码来源:AdvancedSearchFilterComparableCondition.class.php

示例4: getExclusiveFileSyncImportJobsAction

 /**
  * batch getExclusiveFileSyncImportJob action allows to get a BatchJob of type FILESYNC_IMPORT 
  * 
  * @action getExclusiveFileSyncImportJobs
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param int $maxExecutionTime The maximum time in seconds the job reguarly take. Is used for the locking mechanism when determining an unexpected termination of a batch-process.
  * @param int $numberOfJobs The maximum number of jobs to return. 
  * @param KalturaBatchJobFilter $filter Set of rules to fetch only rartial list of jobs  
  * @return KalturaBatchJobArray 
  */
 function getExclusiveFileSyncImportJobsAction(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null)
 {
     $jobs = $this->getExclusiveJobsAction($lockKey, $maxExecutionTime, $numberOfJobs, $filter, BatchJobType::FILESYNC_IMPORT);
     if ($jobs) {
         foreach ($jobs as $job) {
             $data = $job->data;
             // try to get destination path from file sync
             $fileSyncId = $data->filesyncId;
             $fileSync = FileSyncPeer::retrieveByPK($fileSyncId);
             if (!$fileSync) {
                 throw new KalturaAPIException(MultiCentersErrors::INVALID_FILESYNC_RECORD, $fileSyncId);
             }
             $fileSyncRoot = $fileSync->getFileRoot();
             $fileSyncPath = $fileSync->getFilePath();
             if ($fileSyncRoot && $fileSyncPath) {
                 // destination path set on filesync
                 $dest_path = $fileSyncRoot . $fileSyncPath;
             } else {
                 // not set on filesync - get path from path manager
                 $fileSyncKey = kFileSyncUtils::getKeyForFileSync($fileSync);
                 list($file_root, $real_path) = kPathManager::getFilePathArr($fileSyncKey);
                 $dest_path = $file_root . $real_path;
                 // update filesync on database
                 $fileSync->setFileRoot($file_root);
                 $fileSync->setFilePath($real_path);
                 $fileSync->save();
             }
             // update job data with destination path if needed
             if (!$data->destFilePath) {
                 $data->destFilePath = $dest_path;
                 $job->data = $data;
                 KalturaLog::log('Updating destination path for job id [$job->id]');
                 $this->updateJob($job);
             }
             if (!is_dir(dirname($dest_path)) && !@mkdir(dirname($dest_path), 0755, true)) {
                 KalturaLog::ERR("Cannot create directory [{$dest_path}] - " . error_get_last());
             }
         }
     }
     return $jobs;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:51,代码来源:FileSyncImportBatchService.php

示例5: microtime

require_once "../../bootstrap.php";
KalturaLog::setContext("TESTME");
$service = $_GET["service"];
$action = $_GET["action"];
$bench_start = microtime(true);
KalturaLog::INFO(">------- api_v3 testme [{$service}][{$action}]-------");
function toArrayRecursive(KalturaPropertyInfo $propInfo)
{
    return $propInfo->toArray();
}
$serviceMap = KalturaServicesMap::getMap();
$actionInfo = null;
try {
    $serviceReflector = $serviceMap[strtolower($service)];
    /* @var $serviceReflector KalturaServiceActionItem */
    $actionReflector = new KalturaActionReflector($service, $action, $serviceReflector->actionMap[$action]);
    $actionParams = $actionReflector->getActionParams();
    $actionInfo = $actionReflector->getActionInfo();
    $actionInfo = array("actionParams" => array(), "description" => $actionInfo->description);
    foreach ($actionParams as $actionParam) {
        $actionInfo["actionParams"][] = toArrayRecursive($actionParam);
    }
} catch (Exception $ex) {
    KalturaLog::ERR("<------- api_v3 testme [{$service}][{$action}\n" . $ex->__toString() . " " . " -------");
}
//echo "<pre>";
//echo print_r($actionInfo);
echo json_encode($actionInfo);
$bench_end = microtime(true);
KalturaLog::INFO("<------- api_v3 testme [{$service}][{$action}][" . ($bench_end - $bench_start) . "] -------");
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:ajax-get-action-info.php

示例6: getMetadataSearchField

 /**
  * 
  * @param string $field - xPath (metadataProfileField)
  */
 protected function getMetadataSearchField($field = null, $xPaths = array(), &$fieldType = null)
 {
     $fieldType = null;
     if (!$field) {
         return MetadataPlugin::getSphinxFieldName(MetadataPlugin::SPHINX_EXPANDER_FIELD_DATA);
     }
     if (!count($xPaths)) {
         $profileFields = MetadataProfileFieldPeer::retrieveActiveByMetadataProfileId($this->metadataProfileId);
         foreach ($profileFields as $profileField) {
             $xPaths[$profileField->getXpath()] = $profileField;
         }
     }
     if (!isset($xPaths[$field])) {
         KalturaLog::ERR("Missing field: " . $field);
         return null;
     }
     $fieldType = $xPaths[$field]->getType();
     switch ($xPaths[$field]->getType()) {
         case MetadataSearchFilter::KMC_FIELD_TYPE_DATE:
         case MetadataSearchFilter::KMC_FIELD_TYPE_INT:
             $metadataField = MetadataPlugin::SPHINX_DYNAMIC_ATTRIBUTES . "." . MetadataPlugin::getSphinxFieldName($xPaths[$field]->getId());
             break;
         default:
             KalturaLog::ERR("Missing field type: " . $xPaths[$field]->getType());
             return null;
     }
     return $metadataField;
 }
开发者ID:AdiTal,项目名称:server,代码行数:32,代码来源:MetadataSearchFilter.php

示例7: applyCondition

 public function applyCondition(IKalturaDbQuery $query, $xPaths = null)
 {
     if (!$query instanceof IKalturaIndexQuery) {
         return;
     }
     $this->parentQuery = $query;
     if ($this->parentQuery instanceof MetadataSearchFilter || $this->parentQuery instanceof DynamicObjectSearchFilter) {
         $this->metadataProfileId = $this->parentQuery->getMetadataProfileId();
     }
     if (!$this->metadataProfileId) {
         KalturaLog::err('Metadata profile id was not found on parent query, or parent query is not instance of MetadataSearchFilter/DynamicObjectSearchFilter');
         return;
     }
     $field = $this->getField();
     if (!isset($xPaths[$field])) {
         $this->addCondition('1 <> 1');
         KalturaLog::ERR("Missing field: {$field} in xpath array: " . print_r($xPaths, true));
         return;
     }
     /** @var MetadataProfileField $metadataProfileField */
     $metadataProfileField = $xPaths[$field];
     if ($metadataProfileField->getType() !== MetadataSearchFilter::KMC_FIELD_TYPE_METADATA_OBJECT) {
         KalturaLog::ERR("Field {$field} is not set as a dynamic object type");
         return;
     }
     $pluginName = MetadataPlugin::PLUGIN_NAME;
     $fieldId = $metadataProfileField->getId();
     $relatedMetadataProfileId = $metadataProfileField->getRelatedMetadataProfileId();
     $innerXPaths = $this->loadFields($relatedMetadataProfileId);
     $prefix = "{$pluginName}_{$fieldId}";
     $suffix = kMetadataManager::SEARCH_TEXT_SUFFIX . "_{$fieldId}";
     $dataConditions = array();
     foreach ($this->items as $item) {
         if ($item instanceof DynamicObjectSearchFilter) {
             $item->applyCondition($this, $innerXPaths);
             $dataConditions = $item->matchClause;
         } elseif ($item instanceof AdvancedSearchFilterCondition) {
             $innerField = $item->getField();
             if (!isset($innerXPaths[$innerField])) {
                 $this->addCondition('1 <> 1');
                 KalturaLog::ERR("Missing field: {$innerField} in inner xpath array: " . print_r($innerXPaths, true));
                 continue;
             }
             $innerValue = $item->getValue();
             $innerFieldType = $innerXPaths[$innerField]->getType();
             $innerFieldId = $innerXPaths[$innerField]->getId();
             $innerPrefix = $pluginName . '_' . $innerFieldId;
             $innerSuffix = kMetadataManager::SEARCH_TEXT_SUFFIX . '_' . $innerFieldId;
             $dataCondition = "\"{$innerPrefix} {$innerValue} {$innerSuffix}\"";
             KalturaLog::debug("Inner condition: {$dataCondition}");
             $dataConditions[] = $dataCondition;
         }
     }
     if (count($dataConditions)) {
         foreach ($dataConditions as &$dataCondition) {
             $dataCondition = "( {$prefix} ( {$dataCondition} ) {$suffix} )";
             KalturaLog::debug("Wrapped condition: {$dataCondition}");
         }
         $glue = $this->type == MetadataSearchFilter::SEARCH_AND ? ' ' : ' | ';
         $dataConditions = array_unique($dataConditions);
         $value = implode($glue, $dataConditions);
         KalturaLog::debug("Current {$value}");
         $this->addMatch($value);
     }
 }
开发者ID:visomar,项目名称:server,代码行数:65,代码来源:DynamicObjectSearchFilter.php

示例8: handleApplicationException

 public function handleApplicationException(Exception $ex)
 {
     KalturaLog::ERR($ex);
     $this->getResponse()->setHttpResponseCode(500);
     $this->view->message = 'Application error';
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:6,代码来源:ErrorController.php

示例9: die

$actionInfo = null;
if (!array_key_exists(strtolower($service), $serviceMap)) {
    $msg = "<------- api_v3 testme [{$service}][{$action}] not found -------";
    KalturaLog::ERR($msg);
    die($msg);
}
try {
    $serviceReflector = $serviceMap[strtolower($service)];
    if (!array_key_exists($action, $serviceReflector->actionMap)) {
        $msg = "<------- api_v3 testme [{$service}][{$action}] not found -------";
        KalturaLog::ERR($msg);
        die($msg);
    }
    /* @var $serviceReflector KalturaServiceActionItem */
    $actionReflector = new KalturaActionReflector($service, $action, $serviceReflector->actionMap[$action]);
    $actionParams = $actionReflector->getActionParams();
    $actionInfo = $actionReflector->getActionInfo();
    $actionInfo = array("actionParams" => array(), "description" => $actionInfo->description);
    foreach ($actionParams as $actionParam) {
        $actionInfo["actionParams"][] = toArrayRecursive($actionParam);
    }
} catch (Exception $ex) {
    $msg = "<------- api_v3 testme [{$service}][{$action}\n" . $ex->__toString() . " " . " -------";
    KalturaLog::ERR($msg);
    die($msg);
}
//echo "<pre>";
//echo print_r($actionInfo);
echo json_encode($actionInfo);
$bench_end = microtime(true);
KalturaLog::INFO("<------- api_v3 testme [{$service}][{$action}][" . ($bench_end - $bench_start) . "] -------");
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:ajax-get-action-info.php

示例10: cloneAction

 /**
  * Clones an existing mix.
  *
  * @action clone
  * @param string $entryId Mix entry id to clone
  * @return KalturaMixEntry The new mix entry
  */
 function cloneAction($entryId)
 {
     $dbEntry = entryPeer::retrieveByPK($entryId);
     if (!$dbEntry || $dbEntry->getType() != KalturaEntryType::MIX) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $kshowId = $dbEntry->getKshowId();
     $kshow = $dbEntry->getKshow();
     if (!$kshow) {
         KalturaLog::CRIT("Kshow was not found for mix id [" . $entryId . "]");
         throw new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
     }
     $newKshow = myKshowUtils::shalowCloneById($kshowId, $this->getKuser()->getId());
     if (!$newKshow) {
         KalturaLog::ERR("Failed to clone kshow for mix id [" . $entryId . "]");
         throw new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
     }
     $newEntry = $newKshow->getShowEntry();
     $newMixEntry = new KalturaMixEntry();
     $newMixEntry->fromObject($newEntry);
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $newEntry);
     return $newMixEntry;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:MixingService.php

示例11: array

}
$subClasses = array();
try {
    KalturaTypeReflector::setClassInheritMapPath(KAutoloader::buildPath(kConf::get("cache_root_path"), "api_v3", "KalturaClassInheritMap.cache"));
    if (!KalturaTypeReflector::hasClassInheritMapCache()) {
        $config = new Zend_Config_Ini("../../config/testme.ini");
        $indexConfig = $config->get('testme');
        $include = $indexConfig->get("include");
        $exclude = $indexConfig->get("exclude");
        $excludePaths = $indexConfig->get("excludepaths");
        $additional = $indexConfig->get("additional");
        $clientGenerator = new DummyForDocsClientGenerator();
        $clientGenerator->setIncludeOrExcludeList($include, $exclude, $excludePaths);
        $clientGenerator->setAdditionalList($additional);
        $clientGenerator->load();
        $objects = $clientGenerator->getTypes();
        KalturaTypeReflector::setClassMap(array_keys($objects));
    }
    $subClassesNames = KalturaTypeReflector::getSubClasses($type);
    foreach ($subClassesNames as $subClassName) {
        $subClass = new KalturaPropertyInfo($subClassName);
        $subClasses[] = $subClass->toArray();
    }
} catch (Exception $ex) {
    KalturaLog::ERR("<------- api_v3 testme [{$type}]\n" . $ex->__toString() . " " . " -------");
}
//echo "<pre>";
//echo print_r($actionInfo);
echo json_encode($subClasses);
$bench_end = microtime(true);
KalturaLog::INFO("<------- api_v3 testme type [{$type}][" . ($bench_end - $bench_start) . "] -------");
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:ajax-get-type-subclasses.php

示例12: getMetadataSearchField

 /**
  * 
  * @param string $field - xPath (metadataProfileField)
  */
 public function getMetadataSearchField($field = null, $xPaths = array())
 {
     if (!$field) {
         return MetadataPlugin::getSphinxFieldName(MetadataPlugin::SPHINX_EXPANDER_FIELD_DATA);
     }
     if (!count($xPaths)) {
         $profileFields = MetadataProfileFieldPeer::retrieveActiveByMetadataProfileId($this->metadataProfileId);
         foreach ($profileFields as $profileField) {
             $xPaths[$profileField->getXpath()] = $profileField;
         }
     }
     if (!isset($xPaths[$field])) {
         KalturaLog::ERR("Missing field: " . $field);
         return null;
     }
     if (is_null($xPaths[$field]->getSearchIndex())) {
         KalturaLog::ERR("Missing field search index: " . $field);
         return null;
     }
     switch ($xPaths[$field]->getType()) {
         case MetadataSearchFilter::KMC_FIELD_TYPE_DATE:
         case MetadataSearchFilter::KMC_FIELD_TYPE_INT:
             $metadataField = MetadataPlugin::getSphinxFieldName(MetadataPlugin::SPHINX_EXPENDER_FIELD_INT) . $xPaths[$field]->getSearchIndex();
             break;
         default:
             KalturaLog::ERR("Missing field type: " . $xPaths[$field]->getType());
             return null;
     }
     return $metadataField;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:34,代码来源:MetadataSearchFilter.php


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