| @@ 19-29 (lines=11) @@ | ||
| 16 | * @param string $header |
|
| 17 | * @return Struct\Info |
|
| 18 | */ |
|
| 19 | public function add($name, $siteId, $header = '') |
|
| 20 | { |
|
| 21 | $packet = $this->_client->getPacket(); |
|
| 22 | $info = $packet->addChild($this->_wrapperTag)->addChild('add'); |
|
| 23 | ||
| 24 | $info->addChild('site-id', $siteId); |
|
| 25 | $info->addChild('name', $name); |
|
| 26 | $info->addChild('header', $header); |
|
| 27 | ||
| 28 | return new Struct\Info($this->_client->request($packet)); |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @param string $field |
|
| @@ 73-83 (lines=11) @@ | ||
| 70 | * @param string $password |
|
| 71 | * @return Struct\UserInfo |
|
| 72 | */ |
|
| 73 | public function addUser($protectedDirectory, $login, $password) |
|
| 74 | { |
|
| 75 | $packet = $this->_client->getPacket(); |
|
| 76 | $info = $packet->addChild($this->_wrapperTag)->addChild('add-user'); |
|
| 77 | ||
| 78 | $info->addChild('pd-id', $protectedDirectory->id); |
|
| 79 | $info->addChild('login', $login); |
|
| 80 | $info->addChild('password', $password); |
|
| 81 | ||
| 82 | return new Struct\UserInfo($this->_client->request($packet)); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @param string $field |
|
| @@ 33-44 (lines=12) @@ | ||
| 30 | * @param integer|string $value |
|
| 31 | * @return Struct\PhpSettings |
|
| 32 | */ |
|
| 33 | public function getPhpSettings($field, $value) |
|
| 34 | { |
|
| 35 | $packet = $this->_client->getPacket(); |
|
| 36 | $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); |
|
| 37 | ||
| 38 | $getTag->addChild('filter')->addChild($field, $value); |
|
| 39 | $getTag->addChild('dataset')->addChild('php-settings'); |
|
| 40 | ||
| 41 | $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); |
|
| 42 | ||
| 43 | return new Struct\PhpSettings($response); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @param string $field |
|