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

PHP kConf类代码示例

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

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



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

示例1: execute

 public function execute()
 {
     $widgetId = $this->getRequestParameter("wid");
     $widget = widgetPeer::retrieveByPK($widgetId);
     if (!$widget) {
         KalturaLog::err("Widget id [{$widgetId}] not found");
         die;
     }
     $entry = $widget->getentry();
     $entryId = $widget->getEntryId();
     if (!$entry) {
         KalturaLog::err("Entry id [{$entryId}] not found");
         die;
     }
     $uiConf = $widget->getuiConf();
     $uiConfId = $widget->getUiConfId();
     if (!$uiConf) {
         KalturaLog::err("UI Conf id [{$uiConfId}] not found");
         die;
     }
     $widgetPath = "/kwidget/wid/{$widgetId}/entry_id/{$entryId}/ui_conf/{$uiConfId}";
     $this->widget = $widget;
     $this->entry = $entry;
     $this->uiConf = $uiConf;
     $this->entryThumbUrl = $entry->getThumbnailUrl();
     $this->entryThumbSecureUrl = $entry->getThumbnailUrl(null, 'https');
     $this->widgetUrl = 'http://' . kConf::get('www_host') . $widgetPath;
     $this->widgetSecureUrl = 'https://' . kConf::get('www_host') . $widgetPath;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:29,代码来源:openGraphAction.class.php


示例2: isRelativeTimeEnabled

 public static function isRelativeTimeEnabled()
 {
     if (!kConf::hasParam('disable_relative_time_partners')) {
         return true;
     }
     return !in_array(kCurrentContext::getCurrentPartnerId(), kConf::get('disable_relative_time_partners'));
 }
开发者ID:AdiTal,项目名称:server,代码行数:7,代码来源:kTime.class.php


示例3: partnerPermissionEnabled

 protected function partnerPermissionEnabled(Partner $partner)
 {
     $templatePartner = PartnerPeer::retrieveByPK($partner->getI18nTemplatePartnerId() ? $partner->getI18nTemplatePartnerId() : kConf::get('template_partner_id'));
     if ($templatePartner) {
         $this->copyEventNotificationTemplates($templatePartner, $partner, true);
     }
 }
开发者ID:AdiTal,项目名称:server,代码行数:7,代码来源:kEventNotificationObjectCopiedHandler.php


示例4: getAuditTrailConfig

 /**
  * @param int $partnerId
  * @param string $objectType
  * @return AuditTrailConfig
  */
 protected static function getAuditTrailConfig($partnerId, $objectType)
 {
     $config = null;
     if (isset(self::$cachedPartnerConfig[$partnerId])) {
         $config = self::$cachedPartnerConfig[$partnerId];
     } else {
         $cacheFolder = kConf::get("cache_root_path") . "/audit";
         if (!is_dir($cacheFolder)) {
             mkdir($cacheFolder, 0777);
         }
         $cachePath = "{$cacheFolder}/{$partnerId}.cfg";
         if (file_exists($cachePath)) {
             $config = unserialize(file_get_contents($cachePath));
         } else {
             $auditTrailConfigs = AuditTrailConfigPeer::retrieveByPartnerId($partnerId);
             $config = array();
             if (count($auditTrailConfigs)) {
                 foreach ($auditTrailConfigs as $auditTrailConfig) {
                     $config[$auditTrailConfig->getObjectType()] = $auditTrailConfig;
                 }
             }
             file_put_contents($cachePath, serialize($config));
         }
         self::$cachedPartnerConfig[$partnerId] = $config;
     }
     if (!isset($config[$objectType])) {
         KalturaLog::info("Object type [{$objectType}] not audited");
         return null;
     }
     return $config[$objectType];
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:kAuditTrailManager.php


示例5: execute

 public function execute()
 {
     $this->result = 0;
     if (@$_REQUEST["exit"] == "true") {
         $this->systemLogout();
         $login = NULL;
         $password = NULL;
     } else {
         $login = @$_REQUEST["login"];
         $password = @$_REQUEST["pwd"];
     }
     //echo "login: $login, password: $password";
     $this->login = $login;
     $this->sign_in_referer = @$_REQUEST["sign_in_referer"];
     if (empty($this->sign_in_referer)) {
         $this->sign_in_referer = $this->getFlash("sign_in_referer");
     }
     if (empty($login) || empty($password)) {
         $this->result = 0;
     } else {
         if (kConf::hasParam("system_pages_login_password") && sha1($password) == kConf::get("system_pages_login_password")) {
             $this->systemAuthenticated();
             if (empty($this->sign_in_referer)) {
                 // should go back - the original hit was to this page - no reason to go back or refresh
                 $this->result = 2;
             } else {
                 $this->result = 1;
             }
         } else {
             $this->result = -1;
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:loginAction.class.php


示例6: parse

 private static function parse($content)
 {
     $items = array();
     $message = '';
     $doc = new DOMDocument();
     if ($doc->loadXML($content)) {
         $xpath = new DOMXPath($doc);
         $itemNodes = $xpath->query("//item");
         if (!$itemNodes->length) {
             $status = "error";
         } else {
             foreach ($itemNodes as $itemNode) {
                 $ns = "http://search.yahoo.com/mrss/";
                 $id = self::getXmlNodeValue($itemNode, "id");
                 $title = self::getXmlNodeValue($itemNode, "title");
                 $thumbnail = "http://s.mcstatic.com/thumb/" . $id . ".jpg";
                 $duration = self::getXmlNodeValue($itemNode, "content", "duration", $ns);
                 $description = self::getXmlNodeValue($itemNode, "description", null, $ns);
                 $description = strip_tags($description);
                 $tags = self::getXmlNodeValue($itemNode, "keywords", null, $ns);
                 $credit = self::getXmlNodeValue($itemNode, "credit", null, $ns);
                 $link = self::getXmlNodeValue($itemNode, "link");
                 $items[] = array('id' => $id, 'title' => $title, 'thumb' => $thumbnail, 'description' => $description, 'tags' => $tags, 'license' => '', 'credit' => $credit, 'source_link' => $link, 'url' => "http://" . kConf::get("www_host") . "/index.php/extservices/metacafeRedirect/itemId/" . $id);
             }
             $status = "ok";
         }
     } else {
         $status = "error";
     }
     return array('status' => $status, 'message' => $message, 'objects' => $items, "needMediaInfo" => self::$NEED_MEDIA_INFO);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:myMetacafeServices.class.php


示例7: execute

 /**
  * Will forward to the regular swf player according to the widget_id 
  */
 public function execute()
 {
     $ui_conf_id = $this->getRequestParameter("ui_conf_id");
     $uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
     if (!$uiConf) {
         die;
     }
     $partner_id = $uiConf->getPartnerId();
     $subp_id = $uiConf->getSubpId();
     $host = myPartnerUtils::getHost($partner_id);
     $ui_conf_swf_url = $uiConf->getSwfUrl();
     if (!$ui_conf_swf_url) {
         $ui_conf_swf_url = "/swf/simpleeditor.swf";
     }
     if (kString::beginsWith($ui_conf_swf_url, "http")) {
         $swf_url = $ui_conf_swf_url;
         // absolute URL
     } else {
         $use_cdn = $uiConf->getUseCdn();
         $cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
         $swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
         // relative to the current host
     }
     // handle buggy case for backward compatiblity
     $partner_host = $host;
     if ($partner_host == "http://www.kaltura.com") {
         $partner_host = 1;
     }
     // otherwise the kse will build a flawed url with [[IMPORT]]
     $params = "contentUrl=" . urlencode($swf_url) . "&host=" . str_replace("http://", "", str_replace("https://", "", $partner_host)) . "&cdnHost=" . str_replace("http://", "", str_replace("https://", "", myPartnerUtils::getCdnHost($partner_id))) . "&uiConfId=" . $ui_conf_id . "&disableurlhashing=" . kConf::get('disable_url_hashing');
     $wrapper_swf = myContentStorage::getFSFlashRootPath() . "/flexwrapper/" . kConf::get('editors_flex_wrapper_version') . "/FlexWrapper.swf";
     $this->redirect($host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . "{$wrapper_swf}?{$params}");
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:kseAction.class.php


示例8: myCache

 public function myCache($namespace, $expiry = NULL)
 {
     $this->m_namespace = $namespace;
     if (self::$s_memcache == NULL) {
         if (!function_exists('memcache_connect')) {
             return;
         }
         self::$s_memcache = new Memcache();
         //self::$s_memcache->pconnect(self::SERVER, self::PORT) // this will use a persistent connection
         try {
             $res = @self::$s_memcache->connect(kConf::get("memcache_host"), kConf::get("memcache_port"));
         } catch (Exception $e) {
             $res = false;
         }
         if (!$res) {
             kLog::log("ERROR: Error while trying to connect to memcache. Make sure it is properly running on " . kConf::get("memcache_host") . ":" . kConf::get("memcache_port"));
             //throw new Exception ("Error while trying to connect to memcache. Make sure it is properly running on " . self::SERVER . ":" . self::PORT );
         } else {
             self::$s_ready = true;
         }
         //				or die ("Error while trying to connect to memcache. Make sure it is properly running on " . self::SERVER . ":" . self::PORT );
     }
     if ($expiry != null) {
         $this->m_expiry = $expiry;
     }
     if ($this->calculateStats()) {
         $this->m_stats = $this->getStatsObj();
         if ($this->m_stats == NULL) {
             $this->m_stats = new cacheStats();
         }
     } else {
         $this->m_stats = new cacheStats();
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:34,代码来源:myCache.class.php


示例9: validateNestedObjects

 protected function validateNestedObjects($maxPageSize = null, $maxNestingLevel = null)
 {
     $relatedProfiles = $this->relatedProfiles;
     if (!$relatedProfiles) {
         return;
     }
     if (is_null($maxPageSize)) {
         $maxPageSize = kConf::get('response_profile_max_page_size', 'local', 100);
     }
     if (is_null($maxNestingLevel)) {
         $maxNestingLevel = kConf::get('response_profile_max_nesting_level', 'local', 2);
     }
     if ($maxNestingLevel > 0) {
         foreach ($relatedProfiles as $relatedProfile) {
             /* @var $relatedProfile KalturaDetachedResponseProfile */
             $relatedProfile->validateNestedObjects($maxPageSize, $maxNestingLevel - 1);
             $pager = $relatedProfile->pager;
             if ($pager) {
                 $pager->validatePropertyMaxValue('pageSize', $maxPageSize, true);
             }
         }
     } elseif (count($relatedProfiles)) {
         throw new KalturaAPIException(KalturaErrors::RESPONSE_PROFILE_MAX_NESTING_LEVEL);
     }
 }
开发者ID:AdiTal,项目名称:server,代码行数:25,代码来源:KalturaDetachedResponseProfile.php


示例10: getExcludeFileSyncMap

function getExcludeFileSyncMap()
{
    $result = array();
    $dcConfig = kConf::getMap("dc_config");
    if (isset($dcConfig['sync_exclude_types'])) {
        foreach ($dcConfig['sync_exclude_types'] as $syncExcludeType) {
            $configObjectType = $syncExcludeType;
            $configObjectSubType = null;
            if (strpos($syncExcludeType, ':') > 0) {
                list($configObjectType, $configObjectSubType) = explode(':', $syncExcludeType, 2);
            }
            // translate api dynamic enum, such as contentDistribution.EntryDistribution - {plugin name}.{object name}
            if (!is_numeric($configObjectType)) {
                $configObjectType = kPluginableEnumsManager::apiToCore('FileSyncObjectType', $configObjectType);
            }
            // translate api dynamic enum, including the enum type, such as conversionEngineType.mp4box.Mp4box - {enum class name}.{plugin name}.{object name}
            if (!is_null($configObjectSubType) && !is_numeric($configObjectSubType)) {
                list($enumType, $configObjectSubType) = explode('.', $configObjectSubType);
                $configObjectSubType = kPluginableEnumsManager::apiToCore($enumType, $configObjectSubType);
            }
            if (!isset($result[$configObjectType])) {
                $result[$configObjectType] = array();
            }
            if (!is_null($configObjectSubType)) {
                $result[$configObjectType][] = $configObjectSubType;
            }
        }
    }
    return $result;
}
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:fileSyncQueueStatus.php


示例11: __construct

 public function __construct(KalturaDistributionJobData $distributionJobData = null)
 {
     parent::__construct($distributionJobData);
     $this->notificationBaseUrl = 'http://' . kConf::get('cdn_api_host');
     if (!$distributionJobData) {
         return;
     }
     if (!$distributionJobData->distributionProfile instanceof KalturaUnicornDistributionProfile) {
         return;
     }
     $entryDistributionDb = EntryDistributionPeer::retrieveByPK($distributionJobData->entryDistributionId);
     $distributionProfileDb = DistributionProfilePeer::retrieveByPK($distributionJobData->distributionProfileId);
     /* @var $distributionProfileDb UnicornDistributionProfile */
     $flavorAssetIds = explode(',', $entryDistributionDb->getFlavorAssetIds());
     $flavorAssetId = reset($flavorAssetIds);
     $flavorAsset = assetPeer::retrieveById($flavorAssetId);
     $flavorAssetOldVersion = $entryDistributionDb->getFromCustomData(kUnicornDistributionJobProviderData::CUSTOM_DATA_FLAVOR_ASSET_OLD_VERSION);
     $flavorAssetNewVersion = null;
     if ($flavorAsset) {
         $flavorAssetNewVersion = $flavorAsset->getVersion();
     }
     $values = $distributionProfileDb->getAllFieldValues($entryDistributionDb);
     $this->catalogGuid = $values[UnicornDistributionField::CATALOG_GUID];
     $this->title = $values[UnicornDistributionField::TITLE];
     $this->flavorAssetVersion = $flavorAssetNewVersion;
     $this->mediaChanged = $flavorAssetOldVersion != $flavorAssetNewVersion;
 }
开发者ID:DBezemer,项目名称:server,代码行数:27,代码来源:KalturaUnicornDistributionJobProviderData.php


示例12: __construct

 public function __construct()
 {
     // check that rabbit_mq.ini file exists
     if (kConf::hasMap('rabbit_mq')) {
         // check configuration is correctly set
         $rabbitConfig = kConf::getMap('rabbit_mq');
         if (isset($rabbitConfig['username'])) {
             $this->username = $rabbitConfig['username'];
         }
         if (isset($rabbitConfig['password'])) {
             $this->password = $rabbitConfig['password'];
         }
         if (isset($rabbitConfig['server'])) {
             $this->MQserver = $rabbitConfig['server'];
         }
         if (isset($rabbitConfig['port'])) {
             $this->port = $rabbitConfig['port'];
         }
         if (isset($rabbitConfig['curl_port'])) {
             $this->curlPort = $rabbitConfig['curl_port'];
         }
         if (isset($rabbitConfig['timeout'])) {
             $this->timeout = $rabbitConfig['timeout'];
         }
     } else {
         KalturaLog::err("RabbitMQ configuration file (rabbit_mq.ini) wasn't found!");
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:RabbitMQProvider.php


示例13: addAction

 /**
  * Add new CategoryUser
  * 
  * @action add
  * @param KalturaCategoryUser $categoryUser
  * @return KalturaCategoryUser
  */
 function addAction(KalturaCategoryUser $categoryUser)
 {
     $dbCategoryKuser = $categoryUser->toInsertableObject();
     /* @var $dbCategoryKuser categoryKuser */
     $category = categoryPeer::retrieveByPK($categoryUser->categoryId);
     if (!$category) {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_NOT_FOUND, $categoryUser->categoryId);
     }
     $maxUserPerCategory = kConf::get('max_users_per_category');
     if ($category->getMembersCount() >= $maxUserPerCategory) {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_MAX_USER_REACHED, $maxUserPerCategory);
     }
     $currentKuserCategoryKuser = categoryKuserPeer::retrievePermittedKuserInCategory($categoryUser->categoryId, kCurrentContext::getCurrentKsKuserId());
     if (!kEntitlementUtils::getEntitlementEnforcement()) {
         $dbCategoryKuser->setStatus(CategoryKuserStatus::ACTIVE);
         $dbCategoryKuser->setPermissionLevel($categoryUser->permissionLevel);
     } elseif ($currentKuserCategoryKuser && $currentKuserCategoryKuser->getPermissionLevel() == CategoryKuserPermissionLevel::MANAGER) {
         //Current Kuser is manager
         $dbCategoryKuser->setStatus(CategoryKuserStatus::ACTIVE);
     } elseif ($category->getUserJoinPolicy() == UserJoinPolicyType::AUTO_JOIN) {
         $dbCategoryKuser->setPermissionLevel($category->getDefaultPermissionLevel());
         $dbCategoryKuser->setStatus(CategoryKuserStatus::ACTIVE);
     } elseif ($category->getUserJoinPolicy() == UserJoinPolicyType::REQUEST_TO_JOIN) {
         $dbCategoryKuser->setPermissionLevel($category->getDefaultPermissionLevel());
         $dbCategoryKuser->setStatus(CategoryKuserStatus::PENDING);
     } else {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_USER_JOIN_NOT_ALLOWED, $categoryUser->categoryId);
     }
     $dbCategoryKuser->setCategoryFullIds($category->getFullIds());
     $dbCategoryKuser->setPartnerId($this->getPartnerId());
     $dbCategoryKuser->save();
     $categoryUser->fromObject($dbCategoryKuser, $this->getResponseProfile());
     return $categoryUser;
 }
开发者ID:dozernz,项目名称:server,代码行数:41,代码来源:CategoryUserService.php


示例14: getCache

 /**
  * @param int $type
  * @return kBaseCacheWrapper or null on error
  */
 public static function getCache($type)
 {
     if (array_key_exists($type, self::$caches)) {
         return self::$caches[$type];
     }
     if (!array_key_exists($type, self::$cacheConfigs)) {
         return null;
     }
     $config = self::$cacheConfigs[$type];
     $className = "k{$config[0]}CacheWrapper";
     require_once dirname(__FILE__) . '/' . $className . '.php';
     $cache = new $className();
     // get required kConf params
     $config = array_slice($config, 1);
     foreach ($config as $index => $value) {
         if (is_string($value) && substr($value, 0, strlen(self::KCONF_PARAM_PREFIX)) == self::KCONF_PARAM_PREFIX) {
             $value = substr($value, strlen(self::KCONF_PARAM_PREFIX));
             if (!kConf::hasParam($value)) {
                 self::$caches[$type] = null;
                 return null;
             }
             $config[$index] = kConf::get($value);
         }
     }
     // initialize the cache
     if (call_user_func_array(array($cache, 'init'), $config) === false) {
         $cache = null;
     }
     self::$caches[$type] = $cache;
     return $cache;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:35,代码来源:kCacheManager.php


示例15: init

 protected function init()
 {
     if (!parent::init()) {
         return false;
     }
     // ignore params which may hurt caching such as callback, playSessionId
     if (kConf::hasParam('playmanifest_ignore_params')) {
         $ignoreParams = kConf::get('playmanifest_ignore_params');
         foreach ($ignoreParams as $paramName) {
             unset($this->_params[$paramName]);
         }
     }
     $this->_playbackContext = isset($this->_params['playbackContext']) ? $this->_params['playbackContext'] : null;
     unset($this->_params['playbackContext']);
     $this->_deliveryCode = isset($this->_params['deliveryCode']) ? $this->_params['deliveryCode'] : null;
     unset($this->_params['deliveryCode']);
     // take only the hostname part of the referrer parameter of baseEntry.getContextData
     if (isset($this->_params['referrer'])) {
         $referrer = base64_decode(str_replace(" ", "+", $this->_params['referrer']));
         if (!is_string($referrer)) {
             $referrer = "";
         }
         unset($this->_params['referrer']);
     } else {
         $referrer = self::getHttpReferrer();
     }
     $this->_referrers[] = $referrer;
     $this->finalizeCacheKey();
     $this->addExtraFields();
     return true;
 }
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:kPlayManifestCacher.php


示例16: retrieveByLastId

 /**
  * Retrieve all records larger than the id
  *
  * @param      array $servers<SphinxLogServer>
  * @param	   int $gap
  * @param      int $limit
  * @param	   array $handledEntries	
  * @param      PropelPDO $con the connection to use
  * @return     SphinxLog
  */
 public static function retrieveByLastId(array $servers, $gap = 0, $limit = 1000, array $handledEntries = null, PropelPDO $con = null)
 {
     $criteria = new Criteria();
     $criterions = null;
     if (count($servers)) {
         $criterions = $criteria->getNewCriterion(SphinxLogPeer::ID, null, Criteria::ISNULL);
     }
     foreach ($servers as $server) {
         $dc = $server->getDc();
         $crit = $criteria->getNewCriterion(SphinxLogPeer::ID, $server->getLastLogId() - $gap, Criteria::GREATER_THAN);
         $crit->addAnd($criteria->getNewCriterion(SphinxLogPeer::DC, $dc));
         if (!is_null($handledEntries)) {
             $crit->addAnd($criteria->getNewCriterion(SphinxLogPeer::ID, $handledEntries[$dc], Criteria::NOT_IN));
         }
         $criterions->addOr($crit);
     }
     if ($criterions) {
         $criteria->addAnd($criterions);
     }
     $disabledPartnerIds = kConf::get('disable_sphinx_indexing_partners', 'local', array());
     if ($disabledPartnerIds) {
         $criteria->add(SphinxLogPeer::PARTNER_ID, $disabledPartnerIds, Criteria::NOT_IN);
     }
     $criteria->addAscendingOrderByColumn(SphinxLogPeer::ID);
     $criteria->setLimit($limit);
     return SphinxLogPeer::doSelect($criteria, $con);
 }
开发者ID:DBezemer,项目名称:server,代码行数:37,代码来源:SphinxLogPeer.php


示例17: entryHandled

 public function entryHandled(entry $dbEntry)
 {
     parent::entryHandled($dbEntry);
     $originalFlavorAsset = assetPeer::retrieveOriginalByEntryId($dbEntry->getId());
     $syncKey = $originalFlavorAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $sourceFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
     // call mediaInfo for file
     $dbMediaInfo = new mediaInfo();
     try {
         $mediaInfoParser = new KMediaInfoMediaParser($sourceFilePath, kConf::get('bin_path_mediainfo'));
         $mediaInfo = $mediaInfoParser->getMediaInfo();
         $dbMediaInfo = $mediaInfo->toInsertableObject($dbMediaInfo);
         $dbMediaInfo->setFlavorAssetId($originalFlavorAsset->getId());
         $dbMediaInfo->save();
     } catch (Exception $e) {
         KalturaLog::err("Getting media info: " . $e->getMessage());
         $dbMediaInfo = null;
     }
     // fix flavor asset according to mediainfo
     if ($dbMediaInfo) {
         KDLWrap::ConvertMediainfoCdl2FlavorAsset($dbMediaInfo, $originalFlavorAsset);
         $flavorTags = KDLWrap::CDLMediaInfo2Tags($dbMediaInfo, array(flavorParams::TAG_WEB, flavorParams::TAG_MBR));
         $originalFlavorAsset->setTags(implode(',', array_unique($flavorTags)));
     }
     $originalFlavorAsset->setStatusLocalReady();
     $originalFlavorAsset->save();
     $dbEntry->setStatus(entryStatus::READY);
     $dbEntry->save();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:29,代码来源:KalturaWebcamTokenResource.php


示例18: init

 protected static function init()
 {
     if (!kConf::hasParam('monitor_uri')) {
         return null;
     }
     $uri = kConf::get('monitor_uri');
     $pathInfo = parse_url($uri);
     if (isset($pathInfo['host']) && $pathInfo['port']) {
         $host = $pathInfo['host'];
         if (isset($pathInfo['scheme'])) {
             $host = $pathInfo['scheme'] . "://{$host}";
         }
         $errno = null;
         $errstr = null;
         self::$stream = fsockopen($host, $pathInfo['port'], $errno, $errstr, 1);
         if (self::$stream) {
             return true;
         }
         if (class_exists('KalturaLog')) {
             KalturaLog::err("Open socket failed: {$errstr}");
         }
     }
     self::$stream = fopen($uri, 'a');
     if (self::$stream) {
         return true;
     }
     self::$stream = false;
     // prevent init from being called again
     return false;
 }
开发者ID:AdiTal,项目名称:server,代码行数:30,代码来源:KalturaMonitorClient.php


示例19: processKs

 protected function processKs($ksStr, $requiredPermission = null)
 {
     try {
         kCurrentContext::initKsPartnerUser($ksStr);
     } catch (Exception $ex) {
         KalturaLog::err($ex);
         return false;
     }
     if (kCurrentContext::$ks_object->type != ks::SESSION_TYPE_ADMIN) {
         KalturaLog::err('Ks is not admin');
         return false;
     }
     try {
         kPermissionManager::init(kConf::get('enable_cache'));
     } catch (Exception $ex) {
         if (strpos($ex->getCode(), 'INVALID_ACTIONS_LIMIT') === false) {
             KalturaLog::err($ex);
             return false;
         }
     }
     if ($requiredPermission) {
         if (!kPermissionManager::isPermitted(PermissionName::ADMIN_PUBLISHER_MANAGE)) {
             KalturaLog::err('Ks is missing "ADMIN_PUBLISHER_MANAGE" permission');
             return false;
         }
     }
     return true;
 }
开发者ID:dozernz,项目名称:server,代码行数:28,代码来源:oauth2Action.class.php


示例20: createThumbnailAssetFromFile

 public static function createThumbnailAssetFromFile(entry $entry, $filePath)
 {
     try {
         $fileLocation = tempnam(sys_get_temp_dir(), $entry->getId());
         $res = KCurlWrapper::getDataFromFile($filePath, $fileLocation, kConf::get('thumb_size_limit'));
     } catch (Exception $e) {
         KalturaLog::debug($e->getMessage());
         throw new Exception("Data Retrieval Failed");
     }
     if (!$res) {
         KalturaLog::debug("thumbnail cannot be created from {$filePath} " . error_get_last());
         throw new Exception("thumbnail file path is not valid");
     }
     $thumbAsset = new thumbAsset();
     $thumbAsset->setPartnerId($entry->getPartnerId());
     $thumbAsset->setEntryId($entry->getId());
     $thumbAsset->setStatus(thumbAsset::ASSET_STATUS_QUEUED);
     $thumbAsset->incrementVersion();
     $thumbAsset->save();
     $fileSyncKey = $thumbAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
     kFileSyncUtils::moveFromFile($fileLocation, $fileSyncKey);
     $finalPath = kFileSyncUtils::getLocalFilePathForKey($fileSyncKey);
     $ext = pathinfo($finalPath, PATHINFO_EXTENSION);
     $thumbAsset->setFileExt($ext);
     list($width, $height, $type, $attr) = getimagesize($finalPath);
     $thumbAsset->setWidth($width);
     $thumbAsset->setHeight($height);
     $thumbAsset->setSize(filesize($finalPath));
     $thumbAsset->setStatus(thumbAsset::ASSET_STATUS_READY);
     $thumbAsset->save();
     kBusinessConvertDL::setAsDefaultThumbAsset($thumbAsset);
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
 }
开发者ID:kubrickfr,项目名称:server,代码行数:33,代码来源:myEntryUtils.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP kCurrentContext类代码示例发布时间:2022-05-23
下一篇:
PHP kArray类代码示例发布时间: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