public function queueServiceActionCall($service, $action, $params = array(), $files = array()) { // in start session partner id is optional (default -1). if partner id was not set, use the one in the config if (!isset($params["partnerId"]) || $params["partnerId"] === -1) { $params["partnerId"] = $this->config->getPartnerId(); } $this->addParam($params, "ks", $this->ks); $call = new ServiceActionCall($service, $action, $params, $files); $this->callsQueue[] = $call; }
$loader->registerNamespace('Kaltura', dirname(__FILE__) . '/../library/Kaltura'); $loader->registerNamespace('Test', dirname(__FILE__) . '/Test'); $loader->register(); $testerConfig = parse_ini_file(dirname(__FILE__) . '/' . CONFIG_FILE); if ($testerConfig['partnerId'] == 123) { die('Please edit the configuration file (config.ini)'); } // init kaltura configuration $config = new KalturaConfiguration($testerConfig['partnerId']); $config->setServiceUrl($testerConfig['serviceUrl']); $config->setCurlTimeout(30); $config->setLogger(new \Test\SampleLoggerImplementation()); // init kaltura client $client = new KalturaClient($config); // generate session $ks = $client->generateSession($testerConfig['adminSecret'], $testerConfig['userId'], KalturaSessionType::ADMIN, $config->getPartnerId()); $config->getLogger()->log('Kaltura session (ks) was generated successfully: ' . $ks); $client->setKs($ks); // check connectivity try { $client->getSystemService()->ping(); } catch (ApiException $ex) { $config->getLogger()->log('Ping failed with api error: ' . $ex->getMessage()); die; } catch (ClientException $ex) { $config->getLogger()->log('Ping failed with client error: ' . $ex->getMessage()); die; } // run the tester $tester = new \Test\Zend2ClientTester($client); $tester->run();