@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $protocolVersion = !is_null($version) ? $version : $this->_version; |
| 113 | 113 | $content = "<?xml version='1.0' encoding='UTF-8' ?>"; |
| 114 | - $content .= "<packet" . ("" === $protocolVersion ? "" : " version='$protocolVersion'") . "/>"; |
|
| 114 | + $content .= "<packet".("" === $protocolVersion ? "" : " version='$protocolVersion'")."/>"; |
|
| 115 | 115 | return new SimpleXMLElement($content); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | protected function _getOperator($name) |
| 334 | 334 | { |
| 335 | 335 | if (!isset($this->_operatorsCache[$name])) { |
| 336 | - $className = '\\PleskX\\Api\\Operator\\' . $name; |
|
| 336 | + $className = '\\PleskX\\Api\\Operator\\'.$name; |
|
| 337 | 337 | $this->_operatorsCache[$name] = new $className($this); |
| 338 | 338 | } |
| 339 | 339 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | private function _underToCamel($under) |
| 57 | 57 | { |
| 58 | - $under = '_' . str_replace('_', ' ', strtolower($under)); |
|
| 58 | + $under = '_'.str_replace('_', ' ', strtolower($under)); |
|
| 59 | 59 | return ltrim(str_replace(' ', '', ucwords($under)), '_'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function getValue($node) |
| 19 | 19 | { |
| 20 | - return (string)$this->xpath('//' . $node)[0]; |
|
| 20 | + return (string)$this->xpath('//'.$node)[0]; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $site = $client->site()->getAll(); |
|
| 18 | + try { |
|
| 19 | + $site = $client->site()->getAll(); |
|
| 20 | 20 | // Show result |
| 21 | - echo "<pre>"; |
|
| 22 | - print_r($site); |
|
| 23 | - echo "</pre>"; |
|
| 24 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | - echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | - } |
|
| 21 | + echo "<pre>"; |
|
| 22 | + print_r($site); |
|
| 23 | + echo "</pre>"; |
|
| 24 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | + echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | + } |
|
@@ -8,15 +8,15 @@ discard block |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $customer = $client->customer()->create(array( |
|
| 18 | + try { |
|
| 19 | + $customer = $client->customer()->create(array( |
|
| 20 | 20 | 'cname' => 'Example', |
| 21 | 21 | 'pname' => 'Example customer', |
| 22 | 22 | 'login' => 'example', |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | 'state' => '', |
| 31 | 31 | 'pcode' => '', |
| 32 | 32 | 'country' => 'CA' |
| 33 | - )); |
|
| 33 | + )); |
|
| 34 | 34 | |
| 35 | - // Show result |
|
| 36 | - echo "<pre>"; |
|
| 37 | - print_r($customer); |
|
| 38 | - echo "</pre>"; |
|
| 39 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 40 | - echo 'Please verify your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 41 | - } |
|
| 35 | + // Show result |
|
| 36 | + echo "<pre>"; |
|
| 37 | + print_r($customer); |
|
| 38 | + echo "</pre>"; |
|
| 39 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 40 | + echo 'Please verify your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 41 | + } |
|
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $customer = $client->customer()->getAll(); |
|
| 18 | + try { |
|
| 19 | + $customer = $client->customer()->getAll(); |
|
| 20 | 20 | // Show result |
| 21 | - echo "<pre>"; |
|
| 22 | - print_r($customer); |
|
| 23 | - echo "</pre>"; |
|
| 24 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | - echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | - } |
|
| 21 | + echo "<pre>"; |
|
| 22 | + print_r($customer); |
|
| 23 | + echo "</pre>"; |
|
| 24 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | + echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | + } |
|
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $server = $client->server()->getKeyInfo(); |
|
| 20 | - // Show result |
|
| 21 | - echo "<pre>"; |
|
| 22 | - print_r($server); |
|
| 23 | - echo "</pre>"; |
|
| 24 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | - echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | - } |
|
| 18 | + try { |
|
| 19 | + $server = $client->server()->getKeyInfo(); |
|
| 20 | + // Show result |
|
| 21 | + echo "<pre>"; |
|
| 22 | + print_r($server); |
|
| 23 | + echo "</pre>"; |
|
| 24 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | + echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | + } |
|
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $server = $client->server()->getServiceStates(); |
|
| 18 | + try { |
|
| 19 | + $server = $client->server()->getServiceStates(); |
|
| 20 | 20 | // Show result |
| 21 | - echo "<pre>"; |
|
| 22 | - print_r($server); |
|
| 23 | - echo "</pre>"; |
|
| 24 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | - echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | - } |
|
| 21 | + echo "<pre>"; |
|
| 22 | + print_r($server); |
|
| 23 | + echo "</pre>"; |
|
| 24 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | + echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | + } |
|
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | * Change the host, login, password below with your own. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - $host = ""; |
|
| 12 | - $login = ""; |
|
| 13 | - $password = ""; |
|
| 11 | + $host = ""; |
|
| 12 | + $login = ""; |
|
| 13 | + $password = ""; |
|
| 14 | 14 | |
| 15 | - $client = new PleskApiClient($host); |
|
| 16 | - $client->setCredentials($login, $password); |
|
| 15 | + $client = new PleskApiClient($host); |
|
| 16 | + $client->setCredentials($login, $password); |
|
| 17 | 17 | |
| 18 | - try { |
|
| 19 | - $stats = $client->server()->getStatistics(); |
|
| 20 | - // Show result |
|
| 21 | - echo "<pre>"; |
|
| 22 | - print_r($stats); |
|
| 23 | - echo "</pre>"; |
|
| 24 | - } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | - echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | - } |
|
| 18 | + try { |
|
| 19 | + $stats = $client->server()->getStatistics(); |
|
| 20 | + // Show result |
|
| 21 | + echo "<pre>"; |
|
| 22 | + print_r($stats); |
|
| 23 | + echo "</pre>"; |
|
| 24 | + } catch (\PleskX\API\Client\Exception $e) { |
|
| 25 | + echo 'Please check your credentials. Make sure to change the $host, $login, and $password variables in this file.'; |
|
| 26 | + } |
|