本文整理汇总了PHP中Kaltura_Client_Client::generateSession方法的典型用法代码示例。如果您正苦于以下问题:PHP Kaltura_Client_Client::generateSession方法的具体用法?PHP Kaltura_Client_Client::generateSession怎么用?PHP Kaltura_Client_Client::generateSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kaltura_Client_Client
的用法示例。
在下文中一共展示了Kaltura_Client_Client::generateSession方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();