| @@ 126-142 (lines=17) @@ | ||
| 123 | * Returns true if the client can be connected to. |
|
| 124 | * @return bool |
|
| 125 | */ |
|
| 126 | public function ping() |
|
| 127 | { |
|
| 128 | try { |
|
| 129 | $this->oHttpClient->get('/scheduler/jobs'); |
|
| 130 | } catch (HttpConnectionException $e) |
|
| 131 | { |
|
| 132 | if ( |
|
| 133 | $e->getCode() == HttpConnectionException::ERROR_CODE_REQUEST_EXCEPTION || |
|
| 134 | $e->getCode() == HttpConnectionException::ERROR_CODE_CONNECT_EXCEPTION |
|
| 135 | ) |
|
| 136 | { |
|
| 137 | return false; |
|
| 138 | } |
|
| 139 | } |
|
| 140 | ||
| 141 | return true; |
|
| 142 | } |
|
| 143 | } |
|
| @@ 89-104 (lines=16) @@ | ||
| 86 | * Returns true if the client can be connected to. |
|
| 87 | * @return bool |
|
| 88 | */ |
|
| 89 | public function ping() |
|
| 90 | { |
|
| 91 | try { |
|
| 92 | $this->oHttpClient->get('/v2/info'); |
|
| 93 | } catch (HttpConnectionException $e) |
|
| 94 | { |
|
| 95 | if ( |
|
| 96 | $e->getCode() == HttpConnectionException::ERROR_CODE_REQUEST_EXCEPTION || |
|
| 97 | $e->getCode() == HttpConnectionException::ERROR_CODE_CONNECT_EXCEPTION |
|
| 98 | ) |
|
| 99 | { |
|
| 100 | return false; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | return true; |
|
| 104 | } |
|
| 105 | } |
|