$xme2=split(": ",$xme1[3]);
        		$xme=trim($xme2[1]);
        		echo $xme . " " .$title .' ';*/
        return $id;
    } catch (exception $e) {
        /*		$xme1=$client->getResponseHeaders();
        		$xme2=split(": ",$xme1[3]);
        		$xme=trim($xme2[1]);
        		echo $xme . " " .$title .' ';*/
        throw $e;
    }
}
//$rc_file='functions.rc';
$entry_queue = '/tmp/upload_test_queue';
$service_url = $argv[1];
$partnerId = $argv[2];
$secret = $argv[3];
/*exec(". $rc_file ;echo \$MON_PARTNER",$partnerId,$rc);
// sha1 secret
exec(". $rc_file ;echo \$MON_PARTNER_SECRET",$secret,$rc);
if (empty($partnerId) || empty($secret)){
    die("No partner ID and pass, check $rc_file\n");
}*/
$asset_file = $argv[4];
$basedir = dirname(__FILE__);
require_once $basedir . '/create_session.php';
$client = generate_ks($service_url, $partnerId, $secret, $type = KalturaSessionType::USER, $userId = null);
$ext = split("\\.", $asset_file);
$id = upload($client, $asset_file, date("U", time()) . '.' . $ext[1], null, null);
error_log($id . "\n", 3, $entry_queue);
echo $id . "\n";
    echo __FILE__ . ' <admin_secret> <service_url> <flavor_id>' . "\n";
    exit(1);
}
require_once '/opt/kaltura/web/content/clientlibs/php5/KalturaClient.php';
require_once __DIR__ . '/create_session.php';
$userId = null;
$expiry = null;
$privileges = null;
// get with:
// mysql> select admin_secret from partner where id=0\G
$secret = $argv[1];
$type = KalturaSessionType::ADMIN;
$partnerId = 0;
$service_url = $argv[2];
$flavor_id = $argv[3];
$client = generate_ks($service_url, $partnerId, $secret, $type = KalturaSessionType::ADMIN, $userId = null, $expiry = null, $privileges = null);
$flavorParams = new KalturaFlavorParams();
try {
    $results = $client->flavorParams->delete($flavor_id);
} catch (KalturaException $ex) {
    echo $ex->getMessage();
    exit(1);
}
$filter = new KalturaFlavorParamsFilter();
$filter->idEqual = $flavor_id;
try {
    $results = $client->flavorParams->listAction($filter, null);
} catch (KalturaException $ex) {
    echo $ex->getMessage();
    exit(1);
}