Rev | Line | |
---|
[42] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | Class VServices {
|
---|
| 4 |
|
---|
| 5 | private $_apiUrl;
|
---|
| 6 | private $_curlObj;
|
---|
| 7 | private $_userId;
|
---|
| 8 |
|
---|
| 9 | public function __construct() {
|
---|
| 10 |
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | public function setApiUrl($url) {
|
---|
| 14 | $this->_apiUrl = $url;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | public function setConnection($curl) {
|
---|
| 18 | $this->_curlObj = $curl;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public function setUserId ($userId) {
|
---|
| 22 | $this->_userId = $userId;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public function getPrivateTree () {
|
---|
| 26 | $this->_curlObj->create($this->_apiUrl. 'space/dir/isgetall/1');
|
---|
| 27 | $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
|
---|
| 28 | $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
|
---|
| 29 |
|
---|
| 30 | $post = array('userid' => $this->_userId);
|
---|
| 31 | $this->_curlObj->post($post);
|
---|
| 32 | return $this->_curlObj->execute();
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | public function createDir ($dirName, $parentId) {
|
---|
| 36 | $this->_curlObj->create($this->_apiUrl. 'space/mkdir');
|
---|
| 37 | $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
|
---|
| 38 | $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
|
---|
| 39 |
|
---|
| 40 | $post = array('userid' => $this->_userId, 'parent_id' => $parentId, 'name' => $dirName);
|
---|
| 41 | $this->_curlObj->post($post);
|
---|
| 42 | return $this->_curlObj->execute();
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public function __destruct() {
|
---|
| 46 |
|
---|
| 47 | }
|
---|
| 48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.