} $config = get_server_config(); if (!$config) { error("no config file"); } if (!init_db($config)) { error("can't connect to DB"); } $req = json_decode($_POST['request']); switch ($req->operation) { case 'create_observation': create_observation($req); break; case 'create_file': create_file($req); break; case 'delete_file': delete_file($req); break; case 'create_copy_task': create_copy_task($req); break; case 'get_store_list': get_store_list($req); break; case 'recommended_store': recommended_store($req); break; default: error("unknown op {$req->operation}"); }
#! /usr/bin/env php <?php require_once "hl_rpc_client.php"; $ret = create_copy_task(TASK_TYPE_PUSH, "Karoo", "Store 0", "file_1_0", "UCB_test", "Store 0", false); if (!$ret->success) { echo "error: {$ret->message}\n"; }