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


PHP kConf::hasParam方法代码示例

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


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

示例1: 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)
 {
     //		$traces = debug_backtrace(false);
     //		foreach($traces as $i => $trace)
     //		{
     //			$file = $trace['file'];
     //			$line = $trace['line'];
     //			$class = $trace['class'];
     //			$function = $trace['function'];
     //			KalturaLog::debug("#$i Called from function [$class::$function] file[$file] line[$line]");
     //		}
     list($root, $path) = $object->generateFilePathArr($subType, $version);
     $root = str_replace('//', '/', $root);
     $path = str_replace('//', '/', $path);
     if (!kConf::hasParam('volumes')) {
         KalturaLog::debug("Path [{$root}{$path}]");
         return array($root, $path);
     }
     if (isset(self::$sessionCache[$path])) {
         return array($root, self::$sessionCache[$path]);
     }
     $volumes = kConf::get('volumes');
     $volume = $volumes[rand(0, count($volumes) - 1)];
     $newPath = str_replace('/content/', "/content/{$volume}/", $path);
     self::$sessionCache[$path] = $newPath;
     $path = $newPath;
     KalturaLog::debug("Path [{$root}{$path}]");
     return array($root, $path);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:37,代码来源:kPathManager.php

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

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

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

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

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

示例7: getCacheKeyPrefix

 private static function getCacheKeyPrefix()
 {
     $result = self::GLOBAL_CACHE_KEY_PREFIX;
     if (kConf::hasParam('permission_cache_version')) {
         $result .= kConf::get('permission_cache_version');
     }
     return $result;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:8,代码来源:kPermissionManager.php

示例8: 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;
     }
     $this->entry_name = $entry->getName();
     $this->entry_description = $entry->getDescription();
     $this->entry_thumbnail_url = $entry->getThumbnailUrl();
     $this->entry_thumbnail_secure_url = $entry->getThumbnailUrl(null, 'https');
     $this->entry_duration = $entry->getDuration();
     $flavor_tag = $this->getRequestParameter('flavor_tag', 'iphone');
     $flavor_assets = assetPeer::retrieveReadyFlavorsByEntryIdAndTag($entryId, $flavor_tag);
     $flavor_asset = reset($flavor_assets);
     $flavorId = null;
     if ($flavor_asset) {
         $flavorId = $flavor_asset->getId();
     }
     $embed_host = kConf::hasParam('cdn_api_host') ? kConf::get('cdn_api_host') : kConf::get('www_host');
     $embed_host_https = kConf::hasParam('cdn_api_host_https') ? kConf::get('cdn_api_host_https') : kConf::get('www_host');
     $https_enabled = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? true : false;
     $protocol = $https_enabled ? 'https' : 'http';
     $port = $_SERVER["SERVER_PORT"] != "80" ? ":" . $_SERVER["SERVER_PORT"] : '';
     $partnerId = $widget->getPartnerId();
     $this->widget = $widget;
     $this->entry = $entry;
     $this->uiConf = $uiConf;
     // Build SWF Path
     $swfPath = "/index.php/kwidget/wid/" . $widgetId . "/uiconf_id/" . $uiConfId . "/entry_id/" . $entryId;
     // Set SWF URLs
     $this->swfUrl = 'http://' . $embed_host . $swfPath;
     $this->swfSecureUrl = 'https://' . $embed_host_https . $swfPath;
     // set player url
     $this->playerUrl = 'https://' . $embed_host_https . '/p/' . $this->partner_id . '/sp/' . $this->partner_id . '00/embedIframeJs/uiconf_id/' . $this->uiconf_id . '/partner_id/' . $this->partner_id . '?iframeembed=true&entry_id=' . $this->entry_id . '&flashvars[streamerType]=auto';
     $host = $https_enabled ? $embed_host_https : $embed_host;
     $this->html5Url = $protocol . "://" . $host . "/p/" . $partnerId . "/sp/" . $partnerId . "00/embedIframeJs/uiconf_id/" . $uiConfId . "/partner_id/" . $partnerId;
     $this->pageURL = $protocol . '://' . $_SERVER["SERVER_NAME"] . $port . $_SERVER["REQUEST_URI"];
     $this->flavorUrl = null;
     if (isset($flavorId)) {
         $this->flavorUrl = 'https://' . $embed_host_https . '/p/' . $partnerId . '/sp/' . $partnerId . '00/playManifest/entryId/' . $entryId . '/flavorId/' . $flavorId . '/format/url/protocol/' . $protocol . '/a.mp4';
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:56,代码来源:openGraphAction.class.php

示例9: __construct

 public function __construct($filePath, $ffprobeBin = null)
 {
     if (is_null($ffprobeBin)) {
         if (kConf::hasParam('bin_path_ffprobeKAMFMediaInfoParser')) {
             $this->ffprobeBin = kConf::get('bin_path_ffprobeKAMFMediaInfoParser');
         }
     } else {
         $this->ffprobeBin = $ffprobeBin;
     }
     if (!file_exists($filePath)) {
         throw new kApplicativeException(KBaseMediaParser::ERROR_NFS_FILE_DOESNT_EXIST, "File not found at [{$filePath}]");
     }
     $this->filePath = $filePath;
 }
开发者ID:dozernz,项目名称:server,代码行数:14,代码来源:KAMFMediaInfoParser.php

示例10: getExclusiveJobs

 /**
  * will return BatchJob objects.
  *
  * @param kExclusiveLockKey $lockKey
  * @param int $max_execution_time
  * @param int $number_of_objects
  * @param int $jobType
  * @param BatchJobFilter $filter
  */
 public static function getExclusiveJobs(kExclusiveLockKey $lockKey, $max_execution_time, $number_of_objects, $jobType, BatchJobFilter $filter)
 {
     $priority = kBatchManager::getNextJobPriority($jobType);
     $c = new Criteria();
     // added to support nfs delay
     if ($jobType == BatchJobType::EXTRACT_MEDIA || $jobType == BatchJobType::POSTCONVERT || $jobType == BatchJobType::STORAGE_EXPORT) {
         $interval = kConf::hasParam('nfs_safety_margin_sec') ? kConf::get('nfs_safety_margin_sec') : 5;
         $c->add(BatchJobPeer::CREATED_AT, time() - $interval, Criteria::LESS_THAN);
     }
     $c->add(BatchJobPeer::JOB_TYPE, $jobType);
     $c->add(BatchJobPeer::PRIORITY, $priority, Criteria::GREATER_EQUAL);
     $filter->attachToCriteria($c);
     $c->addAscendingOrderByColumn(BatchJobPeer::PRIORITY);
     $max_exe_attempts = BatchJobPeer::getMaxExecutionAttempts($jobType);
     return self::getExclusive($c, $lockKey, $max_execution_time, $number_of_objects, $max_exe_attempts);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:25,代码来源:kBatchExclusiveLock.class.php

示例11: getInstance

 public static function getInstance($partnerId)
 {
     $partner = PartnerPeer::retrieveByPK($partnerId);
     if ($partner->getBroadcastUrlManager()) {
         $broadcastUrlManager = $partner->getBroadcastUrlManager();
         if (class_exists($broadcastUrlManager)) {
             return new $broadcastUrlManager($partnerId);
         }
     }
     if (kConf::hasParam('broadcast_url_manager')) {
         $broadcastUrlManager = kConf::get('broadcast_url_manager');
         if (class_exists($broadcastUrlManager)) {
             return new $broadcastUrlManager($partnerId);
         }
     }
     return new kBroadcastUrlManager($partnerId);
 }
开发者ID:DBezemer,项目名称:server,代码行数:17,代码来源:kBroadcastUrlManager.php

示例12: sendRegistrationInformationForPartner

 public function sendRegistrationInformationForPartner($partner, $skip_emails, $existingUser)
 {
     // email the client with this info
     $adminKuser = kuserPeer::retrieveByPK($partner->getAccountOwnerKuserId());
     $this->sendRegistrationInformation($partner, $adminKuser, $existingUser, null, $partner->getType());
     if (!$skip_emails && kConf::hasParam("report_partner_registration") && kConf::get("report_partner_registration")) {
         // email the wikisupport@kaltura.com  with this info
         $this->sendRegistrationInformation($partner, $adminKuser, $existingUser, self::KALTURA_SUPPORT);
         // if need to hook into SalesForce - this is the place
         if (include_once "mySalesForceUtils.class.php") {
             mySalesForceUtils::sendRegistrationInformationToSalesforce($partner);
         }
         // if need to hook into Marketo - this is the place
         if (include_once "myMarketoUtils.class.php") {
             myMarketoUtils::sendRegistrationInformation($partner);
         }
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:18,代码来源:myPartnerRegistration.class.php

示例13: internalFulfilled

 protected function internalFulfilled(kScope $scope)
 {
     $referrer = $scope->getReferrer();
     if ($this->getNot() === true && !$this->globalWhitelistDomainsAppended && strpos($referrer, "kwidget") === false && kConf::hasParam("global_whitelisted_domains")) {
         $ks = $scope->getKs();
         if (!$ks || !in_array($ks->partner_id, kConf::get('global_whitelisted_domains_exclude'))) {
             $this->globalWhitelistDomainsAppended = true;
             $globalWhitelistedDomains = kConf::get("global_whitelisted_domains");
             if (!is_array($globalWhitelistedDomains)) {
                 $globalWhitelistedDomains = explode(',', $globalWhitelistedDomains);
             }
             foreach ($globalWhitelistedDomains as $globalWhitelistedDomain) {
                 $this->values[] = new kStringValue($globalWhitelistedDomain);
             }
         }
     }
     kApiCache::addExtraField(kApiCache::ECF_REFERRER, kApiCache::COND_SITE_MATCH, $this->getStringValues($scope));
     return parent::internalFulfilled($scope);
 }
开发者ID:DBezemer,项目名称:server,代码行数:19,代码来源:kSiteCondition.php

示例14: setCacheExpiry

function setCacheExpiry($entriesCount, $feedId)
{
    $expiryArr = kConf::hasMap("v3cache_getfeed_expiry") ? kConf::getMap("v3cache_getfeed_expiry") : array();
    foreach ($expiryArr as $item) {
        if ($item["key"] == "partnerId" && $item["value"] == kCurrentContext::$partner_id || $item["key"] == "feedId" && $item["value"] == $feedId) {
            KalturaResponseCacher::setExpiry($item["expiry"]);
            return;
        }
    }
    $expiry = kConf::get("v3cache_getfeed_default_cache_time_frame", 'local', 86400);
    if (kConf::hasParam("v3cache_getfeed_short_limits_array")) {
        $shortLimits = kConf::get("v3cache_getfeed_short_limits_array");
    } else {
        $shortLimits = array(50 => 900, 100 => 1800, 200 => 3600, 400 => 7200);
    }
    foreach ($shortLimits as $numOfEntries => $cacheTimeFrame) {
        if ($entriesCount <= $numOfEntries) {
            $expiry = min($expiry, $cacheTimeFrame);
        }
    }
    KalturaResponseCacher::setExpiry($expiry);
}
开发者ID:kubrickfr,项目名称:server,代码行数:22,代码来源:getFeed.php

示例15: deleteOldFileSyncVersions

 private function deleteOldFileSyncVersions(FileSync $newFileSync)
 {
     KalturaLog::debug('Deleting old file_sync versions for [' . $newFileSync->getId() . ']');
     if (kConf::hasParam('num_of_old_file_sync_versions_to_keep')) {
         $keepCount = kConf::get('num_of_old_file_sync_versions_to_keep');
         if (!is_numeric($newFileSync->getVersion())) {
             return;
         }
         $intVersion = intval($newFileSync->getVersion());
         $c = new Criteria();
         $c->add(FileSyncPeer::OBJECT_ID, $newFileSync->getObjectId());
         $c->add(FileSyncPeer::OBJECT_TYPE, $newFileSync->getObjectType());
         $c->add(FileSyncPeer::OBJECT_SUB_TYPE, $newFileSync->getObjectSubType());
         $c->add(FileSyncPeer::STATUS, array(FileSync::FILE_SYNC_STATUS_PURGED, FileSync::FILE_SYNC_STATUS_DELETED), Criteria::NOT_IN);
         $c->setLimit(40);
         //we limit the number of files to delete in one run so there will be no out of memory issues
         $fileSyncs = FileSyncPeer::doSelect($c);
         foreach ($fileSyncs as $fileSync) {
             if (is_numeric($fileSync->getVersion())) {
                 $currentIntVersion = intval($fileSync->getVersion());
                 if ($intVersion - $keepCount > $currentIntVersion) {
                     $key = kFileSyncUtils::getKeyForFileSync($fileSync);
                     self::deleteSyncFileForKey($key);
                 }
             }
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:kFileSyncUtils.class.php


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