echo "<br />";
 echo "test delObj interface...";
 $ret_del = $client->delObj($token, $testfile, $ftype);
 if ($ret_del->ret == $SUCCESS) {
     echo "delObj is ok. ";
 } else {
     echo "<b>delObj is error. </b>";
     echo $ret_del->msg;
     echo "<br />";
     echo $ret_del->ret;
     echo "<br />";
 }
 echo "<br />";
 echo "<br />";
 echo "test allocobj interface...";
 $alloc_ret = $client->allocobj($token, $ftype, $testfile);
 if ($alloc_ret->result->ret == $SUCCESS) {
     echo "allocobj is ok. ";
     var_dump($alloc_ret->resourceid);
 } else {
     echo "<b>allocobj is error. </b>";
     echo $alloc_ret->result->msg;
     echo "<br />";
     echo $alloc_ret->result->ret;
     echo "<br />";
 }
 echo "<br />";
 echo "<br />";
 echo "test appendObj interface...";
 $append_ret = $client->appendObj($token, $testfile, $filedata, $ftype);
 if ($append_ret->ret == $SUCCESS) {
Exemple #2
0
    $param['bin'] = 0;
    $uploadParam = new \proto\UploadParam($param);
    $upload_ret = $client->uploadFile($uploadParam);
    print "<br />********************<br />";
    var_dump($upload_ret);
    print "<br />********************<br />";
    $ret = $client->verificationLoginAuth('hzshark', 'aerohive', 'ssss');
    var_dump($ret);
    print "<br />********************<br />";
    $ret = $client->loginAuthApp('loginAuthApp', 'hzshark', 'aerohive', 2);
    var_dump($ret);
    print "<br />********************<br />";
    $ret = $client->queryFileList('hzshark', 1);
    var_dump($ret);
    print "<br />********************<br />";
    $ret = $client->allocobj('token', 1, 'allocobj');
    var_dump($ret);
    print "<br />********************<br />";
    $comobj = array('com');
    $ret = $client->commitObj('token', 'commitObj', $comobj);
    var_dump($ret);
    print "<br />********************<br />";
    $appendobj = array('appendobj');
    $ret = $client->appendObj('token', 'appendObj', $appendobj);
    var_dump($ret);
    print "<br />********************<br />";
    $transport->close();
} catch (TException $tx) {
    print 'TException: ' . $tx->getMessage() . "\n";
}
?>
 $auth_ret = $client->loginAuth('18600000000', '123456', 1);
 echo "===3====<br />";
 //     var_dump($auth_ret);
 $token = $auth_ret->token;
 echo "token=>" . $token . PHP_EOL;
 echo "===4===<br />";
 //     $token ="f7a7bcb9ce6221b41ef9f0526ff3a355";
 $ftype = 1;
 $filename = 'apache-jmeter-2.13_src.zip';
 $list_ret = $client->queryFileList($token, $ftype, 0, 10);
 var_dump($list_ret);
 //     exit(0);
 $ret_del = $client->delObj($token, $filename, $ftype);
 var_dump($ret_del);
 echo "====4444==" . PHP_EOL;
 $alloc_ret = $client->allocobj($token, $ftype, $filename);
 var_dump($alloc_ret);
 echo "====5555==" . PHP_EOL;
 $queryobj_ret = $client->queryobj($token, $ftype, $filename);
 var_dump($queryobj_ret);
 $starttime = microtime(true);
 #$filepath = 'C:/Users/hzshark/Desktop/applist/com.yipiao_114128.apk';
 $filepath = '/data/html/www/netdisk_api/apache-jmeter-2.13_src.zip';
 if (file_exists($filepath)) {
     $filesize = filesize($filepath);
     $offset = $queryobj_ret->offset;
     $readlen = 32 * 1024;
     $read_data = file_get_contents($filepath);
     while ($filesize > $offset) {
         $send_data = substr($read_data, $offset, $readlen);
         if ($send_data) {
Exemple #4
0
 echo "===4===<br />";
 $list_ret = $client->queryFileList($token, 1, 0, 10);
 var_dump($list_ret);
 echo "====22==<br />";
 $q_ret = $client->QueryFile($token, 1, 'hello.txt');
 var_dump($q_ret);
 echo "====333==<br />";
 exit(0);
 $download_arr['objid'] = 'hello.txt';
 $download_arr['offerset'] = 0;
 $download_arr['reqlen'] = 1024 * 1024;
 $download_param = new \proto\DownloadParam($download_arr);
 $download = $client->downloadFile($token, $download_param);
 var_dump($download);
 echo "====4444==<br />";
 $alloc_ret = $client->allocobj($token, 1, 'test2.txt');
 var_dump($alloc_ret);
 echo "====5555==<br />";
 //     exit(0);
 //     echo "1-----------<br />";
 //     $token = "01b01749295bde67648c687b44ff408c";
 //     $filename = "aa.txt";
 //     $offer_star = 0;
 //     echo "2-----------<br />";
 //     $param['filename'] = $filename;
 //     $param['offerstar'] = $offer_star;
 //     $param['bin'] = 0;
 //     $filepath = '/tmp/test.thrift';
 //     if (file_exists($filepath)){
 //         $filename = basename($filepath);
 //         print $filename;