Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | Class VServices {
|
---|
4 |
|
---|
5 | private $_apiUrl;
|
---|
6 | private $_curlObj;
|
---|
7 | private $_userId;
|
---|
8 | private $_password;
|
---|
9 |
|
---|
10 | public function __construct() {
|
---|
11 |
|
---|
12 | }
|
---|
13 |
|
---|
14 | public function setApiUrl($url) {
|
---|
15 | $this->_apiUrl = $url;
|
---|
16 | }
|
---|
17 |
|
---|
18 | public function setConnection($curl) {
|
---|
19 | $this->_curlObj = $curl;
|
---|
20 | }
|
---|
21 |
|
---|
22 | public function setUserId ($userId) {
|
---|
23 | $this->_userId = $userId;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public function setPassword ($password) {
|
---|
27 | $this->_password = $password;
|
---|
28 | }
|
---|
29 |
|
---|
30 | public function getPrivateTree () {
|
---|
31 | $this->_curlObj->create($this->_apiUrl. 'space/dir/isgetall/1');
|
---|
32 | $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
|
---|
33 | $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
|
---|
34 |
|
---|
35 | $post = array('userid' => $this->_userId);
|
---|
36 | $this->_curlObj->post($post);
|
---|
37 | return $this->_curlObj->execute();
|
---|
38 | }
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * $aryParams
|
---|
42 | *
|
---|
43 | * @param unknown $action
|
---|
44 | * @param unknown $aryParams
|
---|
45 | */
|
---|
46 | public function actionExecute ($action, $aryParams = array()) {
|
---|
47 | $this->_curlObj->create($this->_apiUrl. 'space/'.$action);
|
---|
48 | $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
|
---|
49 | $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
|
---|
50 |
|
---|
51 | $aryParams['userid'] = $this->_userId;
|
---|
52 | $this->_curlObj->post($aryParams);
|
---|
53 | return $this->_curlObj->execute();
|
---|
54 | }
|
---|
55 |
|
---|
56 | public function __destruct() {
|
---|
57 |
|
---|
58 | }
|
---|
59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.