diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:47 +0000 |
commit | 5419d4428c86c488a43124f85e5407d7cbae6541 (patch) | |
tree | 772c4221a20fd7d1b3e7e67c6e21755a50e80fd7 /library/Director/Core/RestApiClient.php | |
parent | Adding upstream version 1.10.2. (diff) | |
download | icingaweb2-module-director-upstream.tar.xz icingaweb2-module-director-upstream.zip |
Adding upstream version 1.11.1.upstream/1.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Director/Core/RestApiClient.php')
-rw-r--r-- | library/Director/Core/RestApiClient.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/library/Director/Core/RestApiClient.php b/library/Director/Core/RestApiClient.php index b0854ff..19f6b68 100644 --- a/library/Director/Core/RestApiClient.php +++ b/library/Director/Core/RestApiClient.php @@ -206,14 +206,14 @@ class RestApiClient } /** - * @return resource + * @throws RuntimeException */ protected function curl() { if ($this->curl === null) { $this->curl = curl_init(sprintf('https://%s:%d', $this->peer, $this->port)); if (! $this->curl) { - throw new RuntimeException('CURL INIT ERROR: ' . curl_error($this->curl)); + throw new RuntimeException('CURL INIT FAILED'); } } @@ -260,13 +260,11 @@ class RestApiClient public function disconnect() { - if ($this->curl !== null) { - if (is_resource($this->curl)) { - @curl_close($this->curl); - } - - $this->curl = null; + if ($this->curl) { + @curl_close($this->curl); } + + $this->curl = null; } public function __destruct() |