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


PHP Kaltura_Client_Client::setKs方法代码示例

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


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

示例1: getClient

 /**
  *
  * @return Kaltura_Client_Client
  */
 public static function getClient()
 {
     if (self::$client) {
         return self::$client;
     }
     if (!class_exists('Kaltura_Client_Client')) {
         throw new Infra_Exception('Kaltura client not found, maybe it wasn\'t generated', Infra_Exception::ERROR_CODE_MISSING_CLIENT_LIB);
     }
     $ks = self::getKs();
     $config = new Kaltura_Client_Configuration();
     $config->serviceUrl = self::getServiceUrl();
     $config->curlTimeout = self::getCurlTimeout();
     $config->setLogger(new Infra_ClientLoggingProxy());
     $settings = Zend_Registry::get('config')->settings;
     if (isset($settings->clientConfig)) {
         foreach ($settings->clientConfig as $attr => $value) {
             $config->{$attr} = $value;
         }
     }
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam('bootstrap');
     if ($bootstrap) {
         $enviroment = $bootstrap->getApplication()->getEnvironment();
         if ($enviroment === 'development') {
             $config->startZendDebuggerSession = true;
         }
     }
     $client = new Kaltura_Client_Client($config);
     $client->setClientTag('Kaltura-' . $settings->applicationName);
     $client->setKs($ks);
     self::$client = $client;
     return $client;
 }
开发者ID:DBezemer,项目名称:server,代码行数:37,代码来源:ClientHelper.php

示例2: getClient

 /**
  * 
  * @return Kaltura_Client_Client
  */
 public static function getClient()
 {
     if (self::$client) {
         return self::$client;
     }
     if (!class_exists('Kaltura_Client_Client')) {
         throw new Exception('Kaltura client not found, maybe it wasn\'t generated');
     }
     $partnerId = self::getPartnerId();
     $ks = self::getKs();
     $config = new Kaltura_Client_Configuration($partnerId);
     $config->serviceUrl = self::getServiceUrl();
     $config->curlTimeout = self::getCurlTimeout();
     $config->setLogger(new Infra_ClientLoggingProxy());
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam('bootstrap');
     if ($bootstrap) {
         $enviroment = $bootstrap->getApplication()->getEnvironment();
         if ($enviroment === 'development') {
             $config->startZendDebuggerSession = true;
         }
     }
     $client = new Kaltura_Client_Client($config);
     $client->setKs($ks);
     self::$client = $client;
     return $client;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:ClientHelper.php

示例3: registerPartner

 public function registerPartner($partner)
 {
     $config = $this->_client->getConfig();
     $this->_client->setKs(null);
     $config->partnerId = null;
     $oldTimeout = $config->curlTimeout;
     $config->curlTimeout = 40;
     $result = $this->_client->partner->register($partner);
     $config->curlTimeout = $oldTimeout;
     return $result;
 }
开发者ID:Postmedia-Digital,项目名称:kaltura-all-in-one-video-pack,代码行数:11,代码来源:KalturaModel.php

示例4: getClient

 public static function getClient($partnerId, $serviceUrl, $sessionUserId, $adminSecret, $privacyContext = null)
 {
     $config = new \Kaltura_Client_Configuration($partnerId);
     $config->serviceUrl = $serviceUrl;
     $client = new \Kaltura_Client_Client($config);
     $expirySeconds = 86400;
     if (empty($privacyContext)) {
         $privileges = 'disableentitlement';
     } else {
         $privileges = "privacycontext:{$privacyContext},enableentitlement,sessionkey:{$sessionUserId}";
     }
     $ks = $client->generateSessionV2($adminSecret, $sessionUserId, \Kaltura_Client_Enum_SessionType::ADMIN, $partnerId, $expirySeconds, $privileges);
     $client->setKs($ks);
     return $client;
 }
开发者ID:Blaeg,项目名称:kaltura-migrations,代码行数:15,代码来源:Client.php

示例5: dirname

define('CONFIG_FILE', 'config.ini');
require_once dirname(__FILE__) . '/TestsAutoloader.php';
TestsAutoloader::register();
require_once dirname(__FILE__) . '/SampleLoggerImplementation.php';
require_once dirname(__FILE__) . '/Test/ZendClientTester.php';
$testerConfig = parse_ini_file(dirname(__FILE__) . '/' . CONFIG_FILE);
// init kaltura configuration
$config = new Kaltura_Client_Configuration();
$config->serviceUrl = $testerConfig['serviceUrl'];
$config->curlTimeout = 120;
$config->setLogger(new SampleLoggerImplementation());
// init kaltura client
$client = new Kaltura_Client_Client($config);
// generate session
$ks = $client->generateSession($testerConfig['adminSecret'], $testerConfig['userId'], Kaltura_Client_Enum_SessionType::ADMIN, $testerConfig['partnerId']);
$config->getLogger()->log('Kaltura session (ks) was generated successfully: ' . $ks);
$client->setKs($ks);
// check connectivity
try {
    $client->system->ping();
} catch (Kaltura_Client_Exception $ex) {
    $config->getLogger()->log('Ping failed with api error: ' . $ex->getMessage());
    die;
} catch (Kaltura_Client_ClientException $ex) {
    $config->getLogger()->log('Ping failed with client error: ' . $ex->getMessage());
    die;
}
// run the tester
$tester = new ZendClientTester($client, intval($testerConfig['partnerId']));
$tester->run();
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:run.php


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