Esempio n. 1
0
        $responseHeaders = $this->getResponseHeaders();
        foreach ($responseHeaders as $header) {
            if (preg_match('/HTTP\\/?[\\d.]{0,3} ([\\d]{3}) ([^\\n\\r]+)/', $header, $matches)) {
                $errCode = $matches[1];
                continue;
            }
            $parts = explode(':', $header, 2);
            if (count($parts) != 2) {
                continue;
            }
            list($name, $value) = $parts;
            $headers[trim(strtolower($name))] = trim($value);
        }
        $this->resetRequest();
        return $errCode;
    }
}
$config = parse_ini_file(__DIR__ . '/../config.ini', true);
$serviceUrl = $config['client-config']['protocol'] . '://' . $options['service-url'] . ':' . $config['client-config']['port'];
$clientConfig = new KalturaConfiguration();
$clientConfig->serviceUrl = $serviceUrl;
foreach ($config['config'] as $attribute => $value) {
    $clientConfig->{$attribute} = $value;
}
if (isset($options['debug'])) {
    $clientConfig->setLogger(new KalturaMonitorClientLogger());
}
$client = new KalturaMonitorClient($clientConfig);
foreach ($config['client-config'] as $attribute => $value) {
    $client->setClientConfiguration($attribute, $value);
}