예제 #1
0
    $param['token'] = $token;
    $param['filename'] = $filename;
    $param['offerstar'] = $offerstar;
    $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) {
예제 #2
0
 //     }
 $socket = new THttpClient('221.7.13.207', 8080, '/chdserver.php');
 //     $socket = new THttpClient('localhost', 8888, '/chdserver.php');
 $transport = new TBufferedTransport($socket, 1024, 1024);
 $protocol = new TBinaryProtocol($transport);
 $client = new \proto\CloudHardDiskServiceClient($protocol);
 $transport->open();
 $auth_ret = $client->loginAuth('13989497004', 'aerohive', 1);
 echo "===3====<br />";
 var_dump($auth_ret);
 $token = $auth_ret->token;
 echo "===4===<br />";
 //     $token ="f7a7bcb9ce6221b41ef9f0526ff3a355";
 $ftype = 1;
 $filename = '李克勤 - 月半小夜曲.mp3';
 $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==<br />";
 //     $alloc_ret = $client->allocobj($token, $ftype, $filename) ;
 //     var_dump($alloc_ret);
 //     echo "====5555==<br />";
 $queryobj_ret = $client->queryobj($token, $ftype, $filename);
 var_dump($queryobj_ret);
 echo time();
 $filepath = 'C:/Users/hzshark/Desktop/nginx-1.9.7.tar.gz';
 if (file_exists($filepath)) {
     $filesize = filesize($filepath);
     $offset = $queryobj_ret->offset;
예제 #3
0
 //         $socket = new TSocket('localhost', 9090);
 //     }
 $socket = new THttpClient('221.7.13.207', 8080, '/chdserver.php');
 //     $socket = new THttpClient('localhost', 8888, '/chdserver.php');
 $transport = new TBufferedTransport($socket, 1024, 1024);
 $protocol = new TBinaryProtocol($transport);
 $client = new \proto\CloudHardDiskServiceClient($protocol);
 $transport->open();
 echo $client->GetVer();
 echo "===22===<br />";
 $auth_ret = $client->loginAuth('netdisk', 'aerohive', 1);
 echo "===3===<br />";
 var_dump($auth_ret);
 $token = $auth_ret->token;
 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);